Cannot read configuration file due to insufficient permissions


Was getting this issue in one of my ASP.NET application in IIS 7.

Gave Read Permission to IIS_IUSRS on the site.

This fixed the problem.

Good resources for understanding GridView

Check out these wonderful articles on GridView

And the best one,  a cook book on GridView


Body OnLoad function in content page in ASP.NET


I wanted to certain script to run in the onload of the body for my content page.

To do this we need to do the following

Add an id and runat attribute to the body tag in the MASTER page

<body id=”body” runat=”server”>

And in the Content page’s  page load handler

protected void Page_Load(object sender, EventArgs e)
HtmlGenericControl body = this.Master.FindControl(“body”) as HtmlGenericControl;
body.Attributes.Add(“onLoad”, “alert(‘Hello World’);”);


Server Application Unavailable in ASP.NET 2.0


I was getting this error when trying to open a 2.0 page.

However other applications developed in 1.1 were running fine.

Then realized that both of them were using the same Application Pool, so created a new application pool and assigned this new application pool to my 2.0 application.

That solved the issue.

“An application pool is a process that responds to web requests under IIS. An application pool does not have a setting for what type of ASP.Net applications will be run in it. Instead, it loads the appropriate libraries when an ASP.Net application is loaded in the process. Because the libraries for ASP.Net 1.1 and ASP.Net 2.0 are similar, but not the same, the application pool cannot respond to requests for both types of applications at the same time. This can cause sporadic behavior if you are using the server at the same time as another developer and you have applications using different versions of the framework in the same application pool”


Reading querystring using javascript

Hi while searching for the same,

got the following javascript

q =;

getParam = function(arg) {
if (q.indexOf(arg) >= 0) {
var pntr = q.indexOf(arg) + arg.length + 1;
if (q.indexOf(‘&amp;’, pntr) >= 0) {
return q.substring(pntr, q.indexOf(‘&amp;’, pntr));
} else {
return q.substring(pntr, q.length);
} else {
return null;

var objectId = getParam(‘oId’);


or better

function querySt(ji) {
hu =;
gy = hu.split(“&”);
for (i=0;i<gy.length;i++) {
ft = gy[i].split(“=”);
if (ft[0] == ji) {
return ft[1];

var pId= querySt(“pId”);

Here oId is the query string parameter whose value we need.

This works even if there are multiple query string parameters !


Error : The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.


I got this error while developing an page with Sql server as database,

On checking the sql query i found out that the date value was not being sent in the format expected by the database , so by changing the format within my query resolved the issue !

Initially it was calendar.ToShortDateString() and i changed it to 



%d bloggers like this: