Getting the absolute path in ASP.NET which is application independent

There comes a time when you need to get the absolute path to reference a file or some resource existing at some relative path of the website or web application. As things turned i was in need some of the similar functionality. The first thing that came to my mind was doing something similar :
 

//get [...]

Dataset to XML and loss of information

When weneed to persist a dataset object, usually what we do is use the WriteXml() method for the Dataset object. For most cases the default implementation works fine.
So

DataSet dsObj = GetDatasetObject();
dsObj.WriteXml(filename);

If while saving the dataset, a particular contained NULL values, that column information will not be outputted. So when you try to [...]

Using custom serialization to store object information in ViewState

Recently i came across a wierd problem while developing a web user control. I needed to persist some data across page postback’s. I took the ViewState approach, which had been used previously to do the same task.
I had thought that it would be easy as it had been done a multiple times earlier, but [...]

Enum with Flags Attribute and Extension method

For quite some time now i have been intending to write about Enum with Flags attribute set. Enum with Flags attribute set allows the enum to be used as Bit flags where each bit signifies whether a particular option is set or not. When using this very powerful feature there is always a need to [...]

Specify where to look for referenced Assemblies in C# Application

When you design an application it always a good idea to split your code into different modules. Clubbing all the methods, objects which are related to each other together. Inadvertently you may have to define different classes to meet this objective. More often than not you would have separateĀ assemblies or DLL’s which contain this class [...]

Functions with variable parameters in C#

While developing in C# (or any programming language for that matter) you may invariably find your self in need of using overridden functions for accepting different no of parameters.
Let me illustrate with a small example:
Consider a case where you want to add some numbers, if you know how many numbers you are going to add before [...]