Error Logging using ASP.NET 2.0 This article has been republished with a few minor changes. Errors and failures may occur during development and operation of a website. ASP.NET 2.0 provides tracing, instrumentation and error handling mechanisms to detect and fix issues in an application. In this article, we will adopt a simple mechanism to log errors and exceptions in our website. We will be using a mechanism where the user will be redirected to a separate page whenever an error is encountered in the application. Simultaneously, the error will get logged in a text file on the server. The error file will be created on a daily basis, whenever the error is encountered. Having said that, let us now see some code. Step 1: Start by creating an Error folder where all errors will be logged. Right click the website > New Folder. Rename the folder to “Error”. Also add a web.config file, if one does not already exist in your site. Right click the website > Add New Item > Web.config. Step...
LINQ BASIC I am starting from this mail to show the technical skills to work with LINQ . The following is a very basic LINQ Query Expression Example: string[] strCities = { "Mumbai", "Delhi", "Surat", "Chennai", "Ahemdabad", "Jaipur" }; IEnumerable strResult = from city in strCities select city.ToUpper(); grdLinqBasic.DataSource = strResult; grdLinqBasic.DataBind(); In the above Example I am using the array of string and then using LINQ query expression against the array. I am also applying a string operation in the query itself, which help us to modify the result in the query itself. LINQ queries return results of type: IEnumerable Where is determined by the object type of the “select” clause of the query. In the above sample “city” is string. So the above example have the IEnumerable type is “string”. LINQ is STORNGLY-TYPED It means we can have compile-time c...
Following Jquery functions are used to set focus on text box on max length and set focus to prev text box on click of backspace when length gets zero. $(function () { $('.phoneText,.AlternatePhoneText,.FaxText').keyup(function (e) { if (e.which == 8) { if ($(this).val().length == 0) $(this).prev(':input').focus(); } else { if ($(this).val().length == $(this).attr('maxlength')) $(this).next(':input').focus(); } }) })
Comments