As we know that request validation was enabled by default in previous versions of ASP.NET . But it was only applicable for ASPX.NET pages i.e. only for aspx files and their class files. Basically request validation provides a certain level of protection against cross-site scripting (XSS) attacks. In ASP.NET 4.0 , request validation is enabled for all requests as it is enabled before the ...
Before .NET 4.0 , if you want to clean an existing instance of StringBuilder class, then you had to set its length equal to ZERO as there was no method to do the same. e.g. StringBuilder sb= new StringBuilder(); sb.Append("hi"); sb.AppendLine("this is samir"); sb.Length = 0; Now in .NET 4.0, there is a method Clear to clean an instance of StringBuilder class. sb.Clear(); This is a nice e...
In .NET Framework 4.0 , we can sort a list of elements without explicitly implementing any sort algorithms through a new class SortedSet<T>. Let’s create an instance of SortedSet class as- SortedSet<string> sortedSet = new SortedSet<string> { "samir", "kumar", "nigam", "tanu", "nitin" }; Let’s print this set through foreach loop as- foreach (string element in sortedSet)...
As we know that, the method IsNullOrEmpty don’t work on white spaces. e.g. consider the following code snippet – string inputOne = string.Empty; string inputTwo = " "; string inputThree = "\t\r\n\n"; bool resultOne = string.IsNullOrEmpty(inputOne); bool resultTwo = string.IsNullOrEmpty(inputTwo); bool resultThree = string.IsNullOrEmpty(inputThree); Response.Write(string.Format("resultOne...
Introduction As we know that there are two options available for session state management in ASP.NET; In-Process and Out-of-Process. In-Process option has one mode InProc. In InProc mode session is stored as an in memory object in web server (aspnet_wp.exe) in same machine. Out-of-Process has two modes State Server and SQL Server. In State Server mode session is also stored as an in memo...
It's fast, easy and free! Submit articles, get your own blog, ask questions & give answers in the forums, and become a better developer, faster.
enter your email address:
What kind of email newsletter would you prefer to receive from CodeAsp.Net?18