Friday, January 15, 2010

Run (Execute) client script after an AJAX operation using Updatepanel

If there is a need to run a client script after an AJAX operation through UpdatePanel, use ScriptManager.RegisterStartupScript OR ScriptManager.RegisterClientScriptBlock. A typical usage is as follows.

ScriptManager.RegisterStartupScript(this, this.GetType(), "scriptname", "alert('update panel loading complete')", true);

Watch out, as some of these calls are getting deprecated

Additional Info:
http://fredrik.nsquared2.com/ViewPost.aspx?PostId=430

Thursday, December 17, 2009

Difference between nodeName and tagName

If an SPAN element's nodeName is requested, you will get "SPAN". The same will happen for SPAN element's tagName. But, if a text node is requested for nodeName, it will return "#text" and it's tagName will be "undefined", since it's not really a node.

Check the above using
document.getElementById("yourElementId").nodeName
document.getElementById("yourElementId").tagName

Friday, December 11, 2009

Make your website perform faster - Tips

If you are looking for information on how you can make your web pages load faster, here are few sites that should not be missed.

http://code.google.com/speed/
http://developer.yahoo.com/performance/rules.html

There are enormous numbers of articles and videos to learn from. They also discuss various tools for diagnosis and performance testing.

Here are some of the tools that can assist in this:
1. WebDeveloper (Add-on for Firefox)
2. Firebug (Add-on for Firefox)
3. Page Speed (Add-on for Firebug)
4. YSlow (Add-on for Firebug)
5. HttpFox (Add-on for Firefox)
6. HttpWatch

Growing encyclopedia on Javascript and CSS for web developers

If you're a web developer, you should look at this abundant resources on JavaScript and CSS. This covers web security, advanced DOM handling along with cross-browser and cross-platform related articles and sample codes.

http://code.google.com/doctype/