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

http://www.codersource.net/AspNet/ASPNet20/GridviewcontrolinASPNet20.aspx http://www.codersource.net/AspNet/ASPNet20/Aspnet20GridViewcontrolindepth.aspx

http://msdn.microsoft.com/en-us/library/bb288031.aspx

And the best one,  a cook book on GridView

http://highoncoding.com/Categories/7_GridView_Control.aspx

Bye.

Body OnLoad function in content page in ASP.NET


Hi,

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’);”);
}

Bye…

Server Application Unavailable in ASP.NET 2.0


Hi,

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

However other applications developed in asp.net 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 asp.net 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”

Bye..

Reading querystring using javascript


Hi while searching for the same,

got the following javascript

q = location.search;

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’);

alert(objectId);

or better

function querySt(ji) {
hu = window.location.search.substring(1);
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”);
alert(pId);

http://ilovethecode.com/Javascript/Javascript-Tutorials-How_To-Easy/Get_Query_String_Using_Javascript.shtml

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

This works even if there are multiple query string parameters !

Bye…

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


Hi,

I got this error while developing an asp.net 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 

Calendar1.SelectedDate.ToString(“MM/dd/yyyy”)

Bye…

%d bloggers like this: