Loading ...

Who is online?  0 guests and 0 members
home  »  blogs  »  Samir NIGAM: June 2010

Communifire Blogs

Samir NIGAM :June 2010 postings

Samir NIGAM

Request Validation in ASP.NET 4.0

6/8/2010 by Samir NIGAM · 0 · 2336

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 ...

Samir NIGAM

New approach to clear StringBuilder in .NET 4.0

6/17/2010 by Samir NIGAM · 0 · 1299

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...

Samir NIGAM

SortedSet<T> Collection in .NET 4.0

6/17/2010 by Samir NIGAM · 0 · 1214

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)...

Samir NIGAM

string.IsNullOrWhiteSpace() Method in .NET 4.0

6/17/2010 by Samir NIGAM · 0 · 1420

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...

Samir NIGAM

Session State Compression in ASP.NET 4.0

6/4/2010 by Samir NIGAM · 0 · 1681

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...

Page 1 of 1 (5 items)

Product Spotlight

ASP.NET Hosting Spotlight

Join CodeAsp.Net for FREE Today!

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:

 

Quick Vote

What kind of email newsletter would you prefer to receive from CodeAsp.Net?