Thursday, August 2, 2007

C# Compiler Mysteries

This is an ERROR

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
SortedList sl = new SortedList();
}

This is NOT an ERROR

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
SortedList sl = new SortedList();
}
}

Want to know more about this , check out
http://msdn2.microsoft.com/en-us/library/xaw06638(vs.80).aspx

And here you will find more opinions
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1780871&SiteID=1&pageid=0

No comments: