Wednesday, January 5, 2011

How to ppulate dropdown list in FireFox and IE in JQuery

var option = new Option(optionData.Text, optionData.Value);
if ($.browser.msie) {
dropdownList.add(option);
}
else {
dropdownList.add(option, null);
}

How to rotate table (turn rows into columns) in MS SQL

Using PIVOT and UNPIVOT
http://msdn.microsoft.com/en-us/library/ms177410.aspx

ASP.NET events sequence: Page load event in master page is called after content page load event

Page load event in master page is called after content page load event

the master page is merged into the content page and treated as a control in the content page

Events in ASP.NET Master and Content Pages
http://msdn.microsoft.com/en-us/library/dct97kc3.aspx

Application pool recycling default setting in IIS 7 causes invalid state error in ASP.NET


Default setting is 1740 minutes, every 29 hours application poop restart.
If happen in rush hour, will cause a lot of connection are cut off.
Should change this one to third option:  Specific time.

IIS manager -> application pool-> Cycling setting 


How to create an ActionButton in ASP.NET/MVC?

In Model of MVC: you create a html helper by static class

public static class Action
{
public static string ActionButton(this HtmlHelper helper, string Url, string Text)
{
return string.Format(@"<input type='button' onclick=""javacript: window.location='{1}';"" value='{0}' />", Text, Url);
}
}

In html source view of ASPX file:
<%=Html.ActionButton(Page.ResolveUrl("~/ControllerName/ActionName"),"buttonText") %>