Directory Freebies VS CheatSheet Forum

RSS

Email

Translate

Home About Archive Privacy Contact Advertise Write for Dev102
Posted by Shahar A on May 7th, 2008 | Filed under .Net, ASP.Net, C# | 18 Comments

ASP.NET provides mechanisms for storing information for a single user session or across multiple sessions. This is done using the HttpSessionState and HttpApplicationState classes. The Page class has Application and Session attributes to provide access to current objects. The simple way to access them is as following:

if (Session["FirstName"] == null)
{
    LabelFirstName.Text = "FirstName";
}
else
{
    LabelFirstName.Text = (string)Session["FirstName"];
}
if (Session["LastName"] == null)
{
    LabelLastName.Text = "LastName";
}
else
{
    LabelLastName.Text = (string)Session["LastName"];
}

Continue Reading...
Posted by Amit on Mar 17th, 2008 | Filed under ASP.Net | 7 Comments

As we all know whenever we build an ASP.NET application with a MasterPage, all the controls receive a prefix such as “ctl00$<ContentPlaceHolderID>$<NameYouGaveToControl>”  to their names according to their place in the page hierarchy. That is done in order to prevent from two controls to have the same ID on the same page.
We encounter a problem [...]


Continue Reading...
Write Article for Dev102

Write for Dev102!

We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution

Learn More