Posts

Showing posts with the label ASP.NET

Dealing with Database Reader to avoid errors when DB has null value

Introduction Yesterday we were working on a project with my team and we were getting an error message on our production server when I looked at the code, I found titled error. To fix this I am using following code: string connectionString = ConfigurationManager .ConnectionStrings[ "ApplicationServices" ].ConnectionString;             SqlConnection conn = new SqlConnection (connectionString);             conn.Open();             SqlCommand command = new SqlCommand ( "SELECT * FROM NewReRegistration WHERE rollnumber=@RollNumber" , conn);             command.Parameters.Add( new SqlParameter ( "RollNumber" , RollNumber));             SqlDataReader reader = command.ExecuteReader();  ...

Rounded Corner DIV in ASP.NET

Image
Introduction Look at the image given below: In the above image, you can see the rounded corner control. Most of you will guess its image or even you call it as background image, but actually it is not image, its rounded corner DIV. To create such rounded corner DIV you just need to add some special styles with existing DIV tag.  Look at the DIV given below: < div style =" margin :0 auto; background-color :#EAFFFF; -moz-border-radius : 100px; -webkit-border-radius : 100px; border-radius : 100px; padding :15px 15px 15px; width :200px;">             Place your data here </ div > Try the above code it will create the rounded DIV for you. And even it is very concise way because it will take less memory to download.

AutoComplete-Auto Listing (frequently typed texts in TextBox) in ASP.NET

Image
Introduction Look at the image given below: In the above image, you can see there are recently and frequently used numbers are listed when I placed the cursor in the TextBox to type something it comes up. Actually it happens by default and to stop this we need to add special attribute to existing system. In ASP.NET to deal or say top such default system we need to use AutoCompete property of TextBox. We can use AutoComplete property in HTML page as well as code-behind. From HTML Page To turn-off the AutoComplete for any TextBox from HTML Page, we need to use following: < form id= "Form1" method= "post" runat= "server" autocomplete= "off" > OR < form id= "Form1" method= "post" runat= "server" autocomplete= "off" / > OR < asp:TextBox Runat= "server" ID= "Textbox1" autocomplete= "off" ></ asp:TextBox > ...

Website Error Reporter (Smart way to handle website errors) in ASP.NET

Image
Introduction In this article and video post, you will learn how to develop such web application in ASP.NET which can report to the Admin guy about the errors that end users (website users) is experiencing on your blog/website. After reading this post you are definitely going to add this feature to your existing website or blog. I know I'm bit fogy in programming, but I write whatever I experience or learn. Within last 2-3 days I experienced errors on very-very popular websites namely Google, Yahoo and even few technical community websites. I can't doubt on Google or Yahoo because they have very highly qualified system to deal with. But I can doubt on websites which redirect me on the page having following message: Displayed error page "Server Error in '/' Application.", means they are not dealing properly with errors. When I reported to the admin guys, they again asked me back to provide the source URL and target URL, whe...

Distributed ConnectionString in ASP.NET

Image
Introduction In this post you are going to take a look at Distributed ConnectionString in ASP.NET. We will store our configuration settings in separate configuration file (that’s I am calling distributed). Managing huge list of ConnectionStrings in one configuration file (Web.config) is one of the difficult jobs in ASP.NET based web designing. So, I am writing this video post for you that will light a way to deal. Also, Web.config file has much information already so placing connection strings in that creates management difficulties if you work big projects. What I am going to do? I have a Web.config file in my project that has following information (including connection strings): <? xml version = " 1.0 " ?> <!--     Note: As an alternative to hand editing this file you can use the     web admin tool to configure settings for your application. Use     the Website->Asp.Net Configuration option in ...

Popular posts from this blog

Customize User's Profile in ASP.NET Identity System

Migrating database from ASP.NET Identity to ASP.NET Core Identity