Loading ...

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

Communifire Blogs

Samir NIGAM : Most Recent postings

Samir NIGAM

string.IsNullOrWhiteSpace() Method in .NET 4.0

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

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

SortedSet<T> Collection in .NET 4.0

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

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

New approach to clear StringBuilder in .NET 4.0

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

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

Request Validation in ASP.NET 4.0

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

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

Session State Compression in ASP.NET 4.0

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

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

Samir NIGAM

Binding a TreeView control to a hierarchical data structure, Part I

4/8/2010 by Samir NIGAM · 0 · 8974

Download demo application - 6.57 KB Introduction In this blog I'm going to explain how you can bind a TreeView control to a hierarchical data through recursion . TreeView Control Simply drag and Drop a TreeView control by keeping the value of AutoGenerateDataBindings property equal to false . Target Hierarchical Data Target hierarchical data that I've chosen for this demo is a folder's h...

Samir NIGAM

Binding a TreeView control to a hierarchical data structure, Part II

4/8/2010 by Samir NIGAM · 0 · 2270

Download demo application - 6.00 KB Introduction In my last blog Binding a TreeView control to a hierarchical data structure, Part I , I had describe how one can bind a TreeView control to a hierarchical data structure through recursion. Now I’m going to describe how you can bind a TreeView control to a hierarchical data structure on demand. Basically this technique is useful for very lo...

Samir NIGAM

Working with File Attributes

4/7/2010 by Samir NIGAM · 0 · 835

Introduction Here I’m going to show in this small blog how one can manipulate attribute(s) of a file. Getting file’s attribute(s) Attributes of a file can be getting by using GetAttributes static method of File class. This method returns FileAttributes enum which is a bitwise combination of file attribute flags. Setting file’s attribute(s) Attributes of a file can be set by using SetAttr...

Samir NIGAM

Emulating IE7 in IE8 – By adding the Meta tag programmatically

12/29/2009 by Samir NIGAM · 0 · 1621

Introduction In this blog I'm going to pesent how Meta tag can be added on an ASP.NET page programmatically. For other methods, please read the following blogs - Emulating IE7 in IE8 – By adding a Http Header in IIS Emulating IE7 in IE8 – By adding a Meta tag within the head tag on all the pages Emulating IE7 in IE8 – By defining a Custom Header in Web.Config file Method Simply add a Met...

Samir NIGAM

Emulating IE7 in IE8 – By defining a Custom Header in Web.Config file

12/29/2009 by Samir NIGAM · 0 · 3094

Introduction In my last blogs, I had demonstrated how one could emulate IE7 in IE8 demonstrated by adding a Http Header in IIS or by adding a Meta tag within the head tag on all the pages of a web application. Now we'll learn how you can emulate IE7 in by defining a Custom Header in Web.Config file. Method Site administrators can configure their sites to default to a specific document co...

Samir NIGAM

Emulating IE7 in IE8 – By adding a Meta tag within the head tag on all the pages

12/28/2009 by Samir NIGAM · 0 · 2377

Introduction In my last blog: Emulating IE7 in IE8 – By adding a Http Header in IIS I had explained how one could emulate IE7 in IE8 through IIS by adding an Http Header . Now in this article I'm going to exhibit how one can achieve the same by adding a Meta tag within the head tag on each page of the web application. Method Simpley add a Meta tag ( <meta http-equiv="X-UA-Compatible" ...

Samir NIGAM

Emulating IE7 in IE8 – By adding a Http Header in IIS

12/28/2009 by Samir NIGAM · 0 · 7293

Introduction If an ASP.NET web application is working fine in IE6 & IE7 and if you want that the same web application will work in similar manner with IE8 browser without any problem, then you can do it easily by emulating IE7 in IE8 by various ways. In this blog I’m going to explain how can achieve it by simply adding an Http Header in IIS . Adding an Http Header Step I: Open IIS , ...

Page 1 of 1 (12 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?