<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>.Net Thoughts and Ideas - Client Side</title>
    <link>http://xealcom.co.uk/</link>
    <description>Place to share and reflect ...</description>
    <language>en-us</language>
    <copyright>Alex B. Clarke</copyright>
    <lastBuildDate>Sun, 09 May 2010 12:47:22 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>alexclarke@xealcom.net</managingEditor>
    <webMaster>alexclarke@xealcom.net</webMaster>
    <item>
      <trackback:ping>http://xealcom.co.uk/Trackback.aspx?guid=bdfaa89e-fd52-4e9c-adbb-32be342f4e18</trackback:ping>
      <pingback:server>http://xealcom.co.uk/pingback.aspx</pingback:server>
      <pingback:target>http://xealcom.co.uk/PermaLink,guid,bdfaa89e-fd52-4e9c-adbb-32be342f4e18.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://xealcom.co.uk/CommentView,guid,bdfaa89e-fd52-4e9c-adbb-32be342f4e18.aspx</wfw:comment>
      <wfw:commentRss>http://xealcom.co.uk/SyndicationService.asmx/GetEntryCommentsRss?guid=bdfaa89e-fd52-4e9c-adbb-32be342f4e18</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I came across this issue on a fairly complex page - user controls added dynamically,
UpdatePanels, plenty of AJAX... etc.
</p>
        <p>
It was one of the suggestions from <a href="http://stackoverflow.com/questions/2009092/page-loads-twice-in-google-chrome" target="_blank">StackOverflow</a> that
helped me solve this problem. In my case additional Page events where firing twice
was due to black value for the "src" property of one of the "img"
elements in resulting HTML mark-up.
</p>
      </body>
      <title>Page_Load Even Fired Twice in Google Chrome</title>
      <guid isPermaLink="false">http://xealcom.co.uk/PermaLink,guid,bdfaa89e-fd52-4e9c-adbb-32be342f4e18.aspx</guid>
      <link>http://xealcom.co.uk/2010/05/09/PageLoadEvenFiredTwiceInGoogleChrome.aspx</link>
      <pubDate>Sun, 09 May 2010 12:47:22 GMT</pubDate>
      <description>&lt;p&gt;
I came across this issue on a fairly complex page - user controls added dynamically,
UpdatePanels, plenty of AJAX... etc.
&lt;/p&gt;
&lt;p&gt;
It was one of the suggestions from &lt;a href="http://stackoverflow.com/questions/2009092/page-loads-twice-in-google-chrome" target="_blank"&gt;StackOverflow&lt;/a&gt; that
helped me solve this problem. In my case additional Page events where firing twice
was due to black value for the &amp;quot;src&amp;quot; property of one of the &amp;quot;img&amp;quot;
elements in resulting HTML mark-up.
&lt;/p&gt;</description>
      <comments>http://xealcom.co.uk/CommentView,guid,bdfaa89e-fd52-4e9c-adbb-32be342f4e18.aspx</comments>
      <category>Client Side</category>
    </item>
    <item>
      <trackback:ping>http://xealcom.co.uk/Trackback.aspx?guid=43044a3e-928a-472b-9e14-ac3d1dc7bb64</trackback:ping>
      <pingback:server>http://xealcom.co.uk/pingback.aspx</pingback:server>
      <pingback:target>http://xealcom.co.uk/PermaLink,guid,43044a3e-928a-472b-9e14-ac3d1dc7bb64.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://xealcom.co.uk/CommentView,guid,43044a3e-928a-472b-9e14-ac3d1dc7bb64.aspx</wfw:comment>
      <wfw:commentRss>http://xealcom.co.uk/SyndicationService.asmx/GetEntryCommentsRss?guid=43044a3e-928a-472b-9e14-ac3d1dc7bb64</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Not in any specific order here's a collection
of web resources that I found useful when working on client side of Asp.Net applications 
<br /><br /><a href="http://weblogs.asp.net/bleroy/archive/2007/04/23/the-format-for-javascript-doc-comments.aspx">The
format for JavaScript doc comments</a><br /><br /><a href="http://blogs.msdn.com/webdevtools/archive/2007/11/06/jscript-intellisense-a-reference-for-the-reference-tag.aspx">JScript
IntelliSense: A Reference for the “Reference” Tag</a><br /><p><a href="http://plugins.jquery.com/project/json" target="_blank">JSON Plugin for jQuery</a></p><p><a href="http://blog.thinkature.com/index.php/2006/11/26/escaping-the-javascript-call-stack-with-settimeout/" target="_blank">Escaping
the JavaScript call stack with setTimeout</a></p></body>
      <title>Client Side Resources</title>
      <guid isPermaLink="false">http://xealcom.co.uk/PermaLink,guid,43044a3e-928a-472b-9e14-ac3d1dc7bb64.aspx</guid>
      <link>http://xealcom.co.uk/2010/03/21/ClientSideResources.aspx</link>
      <pubDate>Sun, 21 Mar 2010 12:02:20 GMT</pubDate>
      <description>Not in any specific order here's a collection of web resources that I found useful when working on client side of Asp.Net applications   &lt;br&gt;
&lt;br&gt;
&lt;a href="http://weblogs.asp.net/bleroy/archive/2007/04/23/the-format-for-javascript-doc-comments.aspx"&gt;The
format for JavaScript doc comments&lt;/a&gt; 
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://blogs.msdn.com/webdevtools/archive/2007/11/06/jscript-intellisense-a-reference-for-the-reference-tag.aspx"&gt;JScript
IntelliSense: A Reference for the “Reference” Tag&lt;/a&gt; 
&lt;br&gt;
&lt;p&gt;
&lt;a href="http://plugins.jquery.com/project/json" target="_blank"&gt;JSON Plugin for jQuery&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://blog.thinkature.com/index.php/2006/11/26/escaping-the-javascript-call-stack-with-settimeout/" target="_blank"&gt;Escaping
the JavaScript call stack with setTimeout&lt;/a&gt;
&lt;/p&gt;</description>
      <comments>http://xealcom.co.uk/CommentView,guid,43044a3e-928a-472b-9e14-ac3d1dc7bb64.aspx</comments>
      <category>Client Side</category>
    </item>
    <item>
      <trackback:ping>http://xealcom.co.uk/Trackback.aspx?guid=de47de14-6ddf-4828-b064-bb9b2f159839</trackback:ping>
      <pingback:server>http://xealcom.co.uk/pingback.aspx</pingback:server>
      <pingback:target>http://xealcom.co.uk/PermaLink,guid,de47de14-6ddf-4828-b064-bb9b2f159839.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://xealcom.co.uk/CommentView,guid,de47de14-6ddf-4828-b064-bb9b2f159839.aspx</wfw:comment>
      <wfw:commentRss>http://xealcom.co.uk/SyndicationService.asmx/GetEntryCommentsRss?guid=de47de14-6ddf-4828-b064-bb9b2f159839</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <strong>Validate Asp.Net Page from JavaScript</strong>
          <br />
Call Page_ClientValidate()<strong>, </strong>it returns TRUE if validators are happy,
false if not. Use it on client side to prevent javascript code from executing if ASP.Net
validators ring alarm bells. 
<br /><a href="http://www.codeproject.com/KB/aspnet/JavascriptValidation.aspx">http://www.codeproject.com/KB/aspnet/JavascriptValidation.aspx</a></p>
        <p>
          <strong>
          </strong>
        </p>
        <p>
          <strong>Firefox and onChange event</strong>
          <br />
First of all it is fired before keyUp or keyDown 
<br />
Secondly it's fired again when cursor leaves text area 
</p>
        <p>
          <strong>
          </strong>
        </p>
        <p>
          <strong>Firefox and Attributes.Add() Method </strong>
          <br />
In IE to retrieve a custom attribute added in Asp.Net using Control.Attributes.Add()
method, you call element.AttributeName or element['AttributeName']. 
<br />
In Fire Fox we have to use 
<br />
element.attributes['attributeName'].value or 
<br />
element.attributes.attributeName.value
</p>
        <p>
          <strong>
          </strong>
        </p>
        <p>
          <strong>Firefox Css Class Name for Disabled Elements</strong>
          <br />
You can use this class in your css file to alter the disabled elements appearance <code><br />
input[disabled], textarea[disabled], option[disabled], optgroup[disabled], select[disabled] 
<br />
{ 
<br />
  -moz-user-focus:ignore; 
<br />
  -moz-user-input:disabled; 
<br />
  background-color:threedface; 
<br />
  color:graytext; 
<br />
  cursor:inherit; 
<br />
} </code></p>
        <p>
          <strong>
          </strong>
        </p>
        <p>
          <strong>"This page displays secure and unsecure  content ..." Warning
in IE over SSL</strong>
          <br />
This can happen if, as in my case, there are relative paths to resources in client
script and your site is configured to use SSL. To solve this problem either use absolute
path starting with "https://" or move the paths to css. Neither FF no Safari
care about it.
</p>
        <p>
          <strong>
          </strong>
        </p>
        <p>
          <strong>Cell Border Does Not Show When Cell Is Empty - IE Bug Fix</strong>
          <br />
Apply the following style to the table 
<br />
style="empty-cells:show; border-collapse:collapse;"
</p>
        <p>
          <strong>
          </strong>
        </p>
        <p>
          <strong>How to get Text Value from Microsoft AutoCompleteExtender</strong>
          <br />
1. In the web method use the following method to create strings that will be returned
in the array 
<br />
AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(textToShow, valueForTheText
); 
<br />
2. In the AutoCompleteExtender assign event handler 
<br />
OnClientItemSelected="EventHadlerClientSideMethodName" 
<br />
3. In the event handler use the following method signature 
<br />
EventHadlerClientSideMethodName(source, eventArgs) 
<br />
4. Get text and value 
<br />
eventArgs._text 
<br />
eventArgs._value 
<br /><strong></strong></p>
        <p>
          <strong>IE8 will throw an error "Unterminated string constant"</strong>  
<br />
windows.setTimeOut method in IE8 will throw an error "Unterminated string constant"
if newLine  
<br />
carrigeReturn is present. Hence we explicitly replace them with terminating \n\r  
<br />
IE7, FF and Opera are all fine 
</p>
        <p>
          <em>Example</em> - cleaning currentTaskText 
<br />
var re = /\n/g; 
<br />
currentTaskText = currentTaskText.replace(re, '\\n'); 
<br />
re = /\r/g; 
<br />
currentTaskText = currentTaskText.replace(re, '\\r');
</p>
        <p>
          <strong>jQuery Intellisense in Visual Studio 2008</strong>
          <br />
1. Download the latest <a href="http://blogs.msdn.com/webdevtools/archive/2009/02/24/vsdoc-for-jquery-1-3-2-now-available.aspx" target="_blank">"jquery-1.3.2-vsdoc.js"</a><br />
2. Place it in a folder in your project. It does not matter if the project type is
"Web Site" or "Web Application" 
<br />
3. Open your javascript file, the one where you want jQuery intellisense enabled,
in VS2008 
<br />
4. Drag "jquery-1.3.2-vsdoc.js" file and drop it in VS Editor Window. This
will add a line of code similar to this one 
<br />
/// &lt;reference path="../jQuery/js/jquery-1.3.2-vsdoc.js" /&gt;
</p>
        <p>
          <em>IMPORTANT</em>
          <br />
The reference must be the very first line in the file. I had a comment before it and
the intellisense did not work and this kept me busy for a while, googling etc, with
no results, until I just thought about it. 
</p>
        <p>
Just found this great post about referencing other files in javascript files in VS2008 
<br /><a href="http://blogs.msdn.com/webdevtools/archive/2007/11/06/jscript-intellisense-a-reference-for-the-reference-tag.aspx" target="_blank">JScript
IntelliSense: A Reference for the “Reference” Tag</a><br />
It covers all possibilities of referencing.   
</p>
        <p>
          <strong>Storing JSON Object in an Elemet's Attribute 
<br /></strong>Writing JSON object to a newly-created attribute at the time the attribute
is created will not work. 
<br />
So this code is not going to write JSON object correctly, instead it will write a
string '[Object]' 
<br />
var myJsonObj = GetMyJsonObject(); 
<br />
$('#' + elemetId).attr('jsonObject', myJsonObj); 
<br />
Here's how you should do it 
<br />
1. Create an attribute and explicitly declares its initial value as an object 
<br />
$('#' + elemetId).attr('jsonObject', new Object);
</p>
        <p>
2. Get JSON object you want to store and write it to the newly created attribute 
<br />
var myJsonObj = GetMyJsonObject(); 
<br />
$('#' + elemetId).attr('jsonObject', myJsonObj);
</p>
        <p>
          <strong>Detecting Browsers Using CSS Style Sheet</strong>
          <br />
          <a title="http://www.sitepoint.com/forums/showthread.php?threadid=386094" href="http://www.sitepoint.com/forums/showthread.php?threadid=386094">http://www.sitepoint.com/forums/showthread.php?threadid=386094</a>
          <br />
&lt;style type="text/css"&gt; 
<br />
    head+/**/body{background:#ccffcc;}/*min-height browser but not
IE7*/ 
<br />
    /* mac hide \*/ 
<br />
    * html body{background:#ccffff;}/* IE&lt;7 */ 
<br />
    /* End hide */ 
<br />
    *+html body{background:#ffffcc;}/* IE&gt;6 */ 
<br />
    &lt;/style&gt;
</p>
        <p>
also 
<br />
&lt;!--[if IE 6]&gt; 
<br />
Do IE stuff 
<br />
&lt;![endif]--&gt;
</p>
        <p>
plus 
<br />
&lt;!-- for IE7 only --&gt; 
<br />
&lt;!--[if IE 7]&gt; 
<br />
&lt;link rel="stylesheet" type="text/css" href="/xtras/ie7only.css"
media="screen" /&gt; 
<br />
&lt;![endif]--&gt; 
<br />
&lt;!-- for IE6 only --&gt; 
<br />
&lt;!--[if IE 6]&gt; 
<br />
&lt;link rel="stylesheet" type="text/css" href="/xtras/ie6only.css"
media="screen" /&gt; 
<br />
&lt;![endif]--&gt; 
<br />
&lt;!-- for 5 &amp; 5.5 --&gt; 
<br />
&lt;!--[if lt IE 6]&gt; 
<br />
&lt;link rel="stylesheet" type="text/css" href="/xtras/old.css"
media="screen" /&gt; 
<br />
&lt;![endif]--&gt;
</p>
        <p>
to hide code 
<br />
&lt;!-- for everybody else except IE 5, 5.5 and 6 --&gt; 
<br />
&lt;!--[if !IE]&gt;--&gt; 
<br />
&lt;link rel="stylesheet" type="text/css" href="/xtras/new.css"
media="screen" /&gt; 
<br />
&lt;!--&lt;![endif]--&gt;
</p>
        <p>
          <br />
          <strong>Load JavaScripts Dynamically Using jQuery.getScript() 
<br /></strong>
        </p>
        <pre class="hl">
          <span class="hl kwa">function</span>
          <span class="hl kwd">button_click</span>
          <span class="hl sym">()
{</span>
          <span class="hl slc">// Check if method is defined</span>
          <span class="hl kwa">if</span>
          <span class="hl sym">(</span>
          <span class="hl kwa">typeof</span> DynFunction <span class="hl sym">===</span><span class="hl str">"undefined"</span><span class="hl sym">)
{</span><span class="hl slc">// Load script file where the method is defined</span><span class="hl kwa">var</span> req <span class="hl sym">=</span><span class="hl kwd">LoadMyScript</span><span class="hl sym">(</span><span class="hl str">'proj_scripts/dyn-loaded.js'</span><span class="hl sym">);</span><span class="hl slc">//
Check if loaded</span><span class="hl kwa">if</span><span class="hl sym">(</span>req<span class="hl sym">.</span>status <span class="hl sym">===</span><span class="hl num">200</span><span class="hl sym">)
{</span><span class="hl slc">// Call function from the loaded file</span><span class="hl kwd">DynFunction</span><span class="hl sym">();</span><span class="hl sym">}</span><span class="hl sym">}</span><span class="hl sym">}</span><span class="hl kwa">function</span><span class="hl kwd">LoadMyScript</span><span class="hl sym">(</span>scriptName<span class="hl sym">)
{</span><span class="hl slc">// Load synchronously to ensure that the file is fully
loaded</span><span class="hl slc">// before being used</span> $<span class="hl sym">.</span><span class="hl kwd">ajaxSetup</span><span class="hl sym">({</span> async<span class="hl sym">:</span><span class="hl kwa">false</span><span class="hl sym">});</span><span class="hl kwa">var</span> req <span class="hl sym">=</span> $<span class="hl sym">.</span><span class="hl kwd">getScript</span><span class="hl sym">(</span>scriptName<span class="hl sym">);</span><span class="hl slc">//
Revert back to async loading</span> $<span class="hl sym">.</span><span class="hl kwd">ajaxSetup</span><span class="hl sym">({</span> async<span class="hl sym">:</span><span class="hl kwa">true</span><span class="hl sym">});</span><span class="hl kwc">alert</span><span class="hl sym">(</span><span class="hl str">'status:
'</span><span class="hl sym">+</span> req<span class="hl sym">.</span>status <span class="hl sym">+</span><span class="hl str">'</span><span class="hl esc">\n\r</span><span class="hl str">statusText:
'</span><span class="hl sym">+</span> req<span class="hl sym">.</span>statusText<span class="hl sym">);</span><span class="hl kwa">return</span> req<span class="hl sym">;</span><span class="hl sym">}</span></pre>
        <p>
 
</p>
        <p>
          <strong>Reference jQuery in Master Page </strong>
        </p>
        <pre class="hl">
          <span class="hl sym">&lt;%--</span>Referencing javascript in a master
page maintaining intllisence<span class="hl sym">--%&gt;</span><span class="hl sym">&lt;%--</span>Notice <span class="hl str">'~'</span> sign
in the script reference<span class="hl sym">--%&gt;</span><span class="hl sym">&lt;%</span><span class="hl kwa">if</span><span class="hl sym">(</span><span class="hl kwa">false</span><span class="hl sym">)
{ %&gt;</span><span class="hl sym">&lt;</span>script src<span class="hl sym">=</span><span class="hl str">"~/jQuery/js/jquery-1.3.2.min.js"</span> type<span class="hl sym">=</span><span class="hl str">"text/javascript"</span><span class="hl sym">&gt;&lt;/</span>script<span class="hl sym">&gt;</span><span class="hl sym">&lt;%}
%&gt;</span><span class="hl sym">&lt;</span>script src<span class="hl sym">=&lt;%=</span><span class="hl kwd">ResolveUrl</span><span class="hl sym">(</span><span class="hl str">"~/jQuery/js/jquery-1.3.2.min.js"</span><span class="hl sym">)
%&gt;</span> type<span class="hl sym">=</span><span class="hl str">"text/javascript"</span><span class="hl sym">&gt;&lt;/</span>script<span class="hl sym">&gt;</span><span class="hl sym">&lt;%--</span>End<span class="hl sym">--%&gt;</span></pre>
      </body>
      <title>Client Side - Tips</title>
      <guid isPermaLink="false">http://xealcom.co.uk/PermaLink,guid,de47de14-6ddf-4828-b064-bb9b2f159839.aspx</guid>
      <link>http://xealcom.co.uk/2009/02/28/ClientSideTips.aspx</link>
      <pubDate>Sat, 28 Feb 2009 10:58:24 GMT</pubDate>
      <description>&lt;p&gt;
&lt;strong&gt;Validate Asp.Net Page from JavaScript&lt;/strong&gt; 
&lt;br /&gt;
Call Page_ClientValidate()&lt;strong&gt;, &lt;/strong&gt;it returns TRUE if validators are happy,
false if not. Use it on client side to prevent javascript code from executing if ASP.Net
validators ring alarm bells. 
&lt;br /&gt;
&lt;a href="http://www.codeproject.com/KB/aspnet/JavascriptValidation.aspx"&gt;http://www.codeproject.com/KB/aspnet/JavascriptValidation.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Firefox and onChange event&lt;/strong&gt; 
&lt;br /&gt;
First of all it is fired before keyUp or keyDown 
&lt;br /&gt;
Secondly it's fired again when cursor leaves text area 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Firefox and Attributes.Add() Method &lt;/strong&gt; 
&lt;br /&gt;
In IE to retrieve a custom attribute added in Asp.Net using Control.Attributes.Add()
method, you call element.AttributeName or element['AttributeName']. 
&lt;br /&gt;
In Fire Fox we have to use 
&lt;br /&gt;
element.attributes['attributeName'].value or 
&lt;br /&gt;
element.attributes.attributeName.value
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Firefox Css Class Name for Disabled Elements&lt;/strong&gt; 
&lt;br /&gt;
You can use this class in your css file to alter the disabled elements appearance &lt;code&gt; 
&lt;br /&gt;
input[disabled], textarea[disabled], option[disabled], optgroup[disabled], select[disabled] 
&lt;br /&gt;
{ 
&lt;br /&gt;
&amp;#160; -moz-user-focus:ignore; 
&lt;br /&gt;
&amp;#160; -moz-user-input:disabled; 
&lt;br /&gt;
&amp;#160; background-color:threedface; 
&lt;br /&gt;
&amp;#160; color:graytext; 
&lt;br /&gt;
&amp;#160; cursor:inherit; 
&lt;br /&gt;
} &lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&amp;quot;This page displays secure and unsecure&amp;#160; content ...&amp;quot; Warning
in IE over SSL&lt;/strong&gt; 
&lt;br /&gt;
This can happen if, as in my case, there are relative paths to resources in client
script and your site is configured to use SSL. To solve this problem either use absolute
path starting with &amp;quot;https://&amp;quot; or move the paths to css. Neither FF no Safari
care about it.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Cell Border Does Not Show When Cell Is Empty - IE Bug Fix&lt;/strong&gt; 
&lt;br /&gt;
Apply the following style to the table 
&lt;br /&gt;
style=&amp;quot;empty-cells:show; border-collapse:collapse;&amp;quot;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;How to get Text Value from Microsoft AutoCompleteExtender&lt;/strong&gt; 
&lt;br /&gt;
1. In the web method use the following method to create strings that will be returned
in the array 
&lt;br /&gt;
AjaxControlToolkit.AutoCompleteExtender.CreateAutoCompleteItem(textToShow, valueForTheText
); 
&lt;br /&gt;
2. In the AutoCompleteExtender assign event handler 
&lt;br /&gt;
OnClientItemSelected=&amp;quot;EventHadlerClientSideMethodName&amp;quot; 
&lt;br /&gt;
3. In the event handler use the following method signature 
&lt;br /&gt;
EventHadlerClientSideMethodName(source, eventArgs) 
&lt;br /&gt;
4. Get text and value 
&lt;br /&gt;
eventArgs._text 
&lt;br /&gt;
eventArgs._value 
&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;IE8 will throw an error &amp;quot;Unterminated string constant&amp;quot;&lt;/strong&gt;&amp;#160; 
&lt;br /&gt;
windows.setTimeOut method in IE8 will throw an error &amp;quot;Unterminated string constant&amp;quot;
if newLine&amp;#160; 
&lt;br /&gt;
carrigeReturn is present. Hence we explicitly replace them with terminating \n\r&amp;#160; 
&lt;br /&gt;
IE7, FF and Opera are all fine 
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Example&lt;/em&gt; - cleaning currentTaskText 
&lt;br /&gt;
var re = /\n/g; 
&lt;br /&gt;
currentTaskText = currentTaskText.replace(re, '\\n'); 
&lt;br /&gt;
re = /\r/g; 
&lt;br /&gt;
currentTaskText = currentTaskText.replace(re, '\\r');
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;jQuery Intellisense in Visual Studio 2008&lt;/strong&gt; 
&lt;br /&gt;
1. Download the latest &lt;a href="http://blogs.msdn.com/webdevtools/archive/2009/02/24/vsdoc-for-jquery-1-3-2-now-available.aspx" target="_blank"&gt;&amp;quot;jquery-1.3.2-vsdoc.js&amp;quot;&lt;/a&gt; 
&lt;br /&gt;
2. Place it in a folder in your project. It does not matter if the project type is
&amp;quot;Web Site&amp;quot; or &amp;quot;Web Application&amp;quot; 
&lt;br /&gt;
3. Open your javascript file, the one where you want jQuery intellisense enabled,
in VS2008 
&lt;br /&gt;
4. Drag &amp;quot;jquery-1.3.2-vsdoc.js&amp;quot; file and drop it in VS Editor Window. This
will add a line of code similar to this one 
&lt;br /&gt;
/// &amp;lt;reference path=&amp;quot;../jQuery/js/jquery-1.3.2-vsdoc.js&amp;quot; /&amp;gt;
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;IMPORTANT&lt;/em&gt; 
&lt;br /&gt;
The reference must be the very first line in the file. I had a comment before it and
the intellisense did not work and this kept me busy for a while, googling etc, with
no results, until I just thought about it. 
&lt;/p&gt;
&lt;p&gt;
Just found this great post about referencing other files in javascript files in VS2008 
&lt;br /&gt;
&lt;a href="http://blogs.msdn.com/webdevtools/archive/2007/11/06/jscript-intellisense-a-reference-for-the-reference-tag.aspx" target="_blank"&gt;JScript
IntelliSense: A Reference for the “Reference” Tag&lt;/a&gt; 
&lt;br /&gt;
It covers all possibilities of referencing.&amp;#160;&amp;#160; 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Storing JSON Object in an Elemet's Attribute 
&lt;br /&gt;
&lt;/strong&gt;Writing JSON object to a newly-created attribute at the time the attribute
is created will not work. 
&lt;br /&gt;
So this code is not going to write JSON object correctly, instead it will write a
string '[Object]' 
&lt;br /&gt;
var myJsonObj = GetMyJsonObject(); 
&lt;br /&gt;
$('#' + elemetId).attr('jsonObject', myJsonObj); 
&lt;br /&gt;
Here's how you should do it 
&lt;br /&gt;
1. Create an attribute and explicitly declares its initial value as an object 
&lt;br /&gt;
$('#' + elemetId).attr('jsonObject', new Object);
&lt;/p&gt;
&lt;p&gt;
2. Get JSON object you want to store and write it to the newly created attribute 
&lt;br /&gt;
var myJsonObj = GetMyJsonObject(); 
&lt;br /&gt;
$('#' + elemetId).attr('jsonObject', myJsonObj);
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Detecting Browsers Using CSS Style Sheet&lt;/strong&gt; 
&lt;br /&gt;
&lt;a title="http://www.sitepoint.com/forums/showthread.php?threadid=386094" href="http://www.sitepoint.com/forums/showthread.php?threadid=386094"&gt;http://www.sitepoint.com/forums/showthread.php?threadid=386094&lt;/a&gt; 
&lt;br /&gt;
&amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt; 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; head+/**/body{background:#ccffcc;}/*min-height browser but not
IE7*/ 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; /* mac hide \*/ 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; * html body{background:#ccffff;}/* IE&amp;lt;7 */ 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; /* End hide */ 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; *+html body{background:#ffffcc;}/* IE&amp;gt;6 */ 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; &amp;lt;/style&amp;gt;
&lt;/p&gt;
&lt;p&gt;
also 
&lt;br /&gt;
&amp;lt;!--[if IE 6]&amp;gt; 
&lt;br /&gt;
Do IE stuff 
&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;
&lt;/p&gt;
&lt;p&gt;
plus 
&lt;br /&gt;
&amp;lt;!-- for IE7 only --&amp;gt; 
&lt;br /&gt;
&amp;lt;!--[if IE 7]&amp;gt; 
&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/xtras/ie7only.css&amp;quot;
media=&amp;quot;screen&amp;quot; /&amp;gt; 
&lt;br /&gt;
&amp;lt;![endif]--&amp;gt; 
&lt;br /&gt;
&amp;lt;!-- for IE6 only --&amp;gt; 
&lt;br /&gt;
&amp;lt;!--[if IE 6]&amp;gt; 
&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/xtras/ie6only.css&amp;quot;
media=&amp;quot;screen&amp;quot; /&amp;gt; 
&lt;br /&gt;
&amp;lt;![endif]--&amp;gt; 
&lt;br /&gt;
&amp;lt;!-- for 5 &amp;amp; 5.5 --&amp;gt; 
&lt;br /&gt;
&amp;lt;!--[if lt IE 6]&amp;gt; 
&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/xtras/old.css&amp;quot;
media=&amp;quot;screen&amp;quot; /&amp;gt; 
&lt;br /&gt;
&amp;lt;![endif]--&amp;gt;
&lt;/p&gt;
&lt;p&gt;
to hide code 
&lt;br /&gt;
&amp;lt;!-- for everybody else except IE 5, 5.5 and 6 --&amp;gt; 
&lt;br /&gt;
&amp;lt;!--[if !IE]&amp;gt;--&amp;gt; 
&lt;br /&gt;
&amp;lt;link rel=&amp;quot;stylesheet&amp;quot; type=&amp;quot;text/css&amp;quot; href=&amp;quot;/xtras/new.css&amp;quot;
media=&amp;quot;screen&amp;quot; /&amp;gt; 
&lt;br /&gt;
&amp;lt;!--&amp;lt;![endif]--&amp;gt;
&lt;/p&gt;
&lt;p&gt;
&lt;br /&gt;
&lt;strong&gt;Load JavaScripts Dynamically Using jQuery.getScript() 
&lt;br /&gt;
&lt;/strong&gt;
&lt;/p&gt;
&lt;pre class="hl"&gt;&lt;span class="hl kwa"&gt;function&lt;/span&gt; &lt;span class="hl kwd"&gt;button_click&lt;/span&gt;&lt;span class="hl sym"&gt;()
{&lt;/span&gt; &lt;span class="hl slc"&gt;// Check if method is defined&lt;/span&gt; &lt;span class="hl kwa"&gt;if&lt;/span&gt; &lt;span class="hl sym"&gt;(&lt;/span&gt;&lt;span class="hl kwa"&gt;typeof&lt;/span&gt; DynFunction &lt;span class="hl sym"&gt;===&lt;/span&gt; &lt;span class="hl str"&gt;&amp;quot;undefined&amp;quot;&lt;/span&gt;&lt;span class="hl sym"&gt;)
{&lt;/span&gt; &lt;span class="hl slc"&gt;// Load script file where the method is defined&lt;/span&gt; &lt;span class="hl kwa"&gt;var&lt;/span&gt; req &lt;span class="hl sym"&gt;=&lt;/span&gt; &lt;span class="hl kwd"&gt;LoadMyScript&lt;/span&gt;&lt;span class="hl sym"&gt;(&lt;/span&gt;&lt;span class="hl str"&gt;'proj_scripts/dyn-loaded.js'&lt;/span&gt;&lt;span class="hl sym"&gt;);&lt;/span&gt; &lt;span class="hl slc"&gt;//
Check if loaded&lt;/span&gt; &lt;span class="hl kwa"&gt;if&lt;/span&gt; &lt;span class="hl sym"&gt;(&lt;/span&gt;req&lt;span class="hl sym"&gt;.&lt;/span&gt;status &lt;span class="hl sym"&gt;===&lt;/span&gt; &lt;span class="hl num"&gt;200&lt;/span&gt;&lt;span class="hl sym"&gt;)
{&lt;/span&gt; &lt;span class="hl slc"&gt;// Call function from the loaded file&lt;/span&gt; &lt;span class="hl kwd"&gt;DynFunction&lt;/span&gt;&lt;span class="hl sym"&gt;();&lt;/span&gt; &lt;span class="hl sym"&gt;}&lt;/span&gt; &lt;span class="hl sym"&gt;}&lt;/span&gt; &lt;span class="hl sym"&gt;}&lt;/span&gt; &lt;span class="hl kwa"&gt;function&lt;/span&gt; &lt;span class="hl kwd"&gt;LoadMyScript&lt;/span&gt;&lt;span class="hl sym"&gt;(&lt;/span&gt;scriptName&lt;span class="hl sym"&gt;)
{&lt;/span&gt; &lt;span class="hl slc"&gt;// Load synchronously to ensure that the file is fully
loaded&lt;/span&gt; &lt;span class="hl slc"&gt;// before being used&lt;/span&gt; $&lt;span class="hl sym"&gt;.&lt;/span&gt;&lt;span class="hl kwd"&gt;ajaxSetup&lt;/span&gt;&lt;span class="hl sym"&gt;({&lt;/span&gt; async&lt;span class="hl sym"&gt;:&lt;/span&gt; &lt;span class="hl kwa"&gt;false&lt;/span&gt; &lt;span class="hl sym"&gt;});&lt;/span&gt; &lt;span class="hl kwa"&gt;var&lt;/span&gt; req &lt;span class="hl sym"&gt;=&lt;/span&gt; $&lt;span class="hl sym"&gt;.&lt;/span&gt;&lt;span class="hl kwd"&gt;getScript&lt;/span&gt;&lt;span class="hl sym"&gt;(&lt;/span&gt;scriptName&lt;span class="hl sym"&gt;);&lt;/span&gt; &lt;span class="hl slc"&gt;//
Revert back to async loading&lt;/span&gt; $&lt;span class="hl sym"&gt;.&lt;/span&gt;&lt;span class="hl kwd"&gt;ajaxSetup&lt;/span&gt;&lt;span class="hl sym"&gt;({&lt;/span&gt; async&lt;span class="hl sym"&gt;:&lt;/span&gt; &lt;span class="hl kwa"&gt;true&lt;/span&gt; &lt;span class="hl sym"&gt;});&lt;/span&gt; &lt;span class="hl kwc"&gt;alert&lt;/span&gt;&lt;span class="hl sym"&gt;(&lt;/span&gt;&lt;span class="hl str"&gt;'status:
'&lt;/span&gt; &lt;span class="hl sym"&gt;+&lt;/span&gt; req&lt;span class="hl sym"&gt;.&lt;/span&gt;status &lt;span class="hl sym"&gt;+&lt;/span&gt; &lt;span class="hl str"&gt;'&lt;/span&gt;&lt;span class="hl esc"&gt;\n\r&lt;/span&gt;&lt;span class="hl str"&gt;statusText:
'&lt;/span&gt; &lt;span class="hl sym"&gt;+&lt;/span&gt; req&lt;span class="hl sym"&gt;.&lt;/span&gt;statusText&lt;span class="hl sym"&gt;);&lt;/span&gt; &lt;span class="hl kwa"&gt;return&lt;/span&gt; req&lt;span class="hl sym"&gt;;&lt;/span&gt; &lt;span class="hl sym"&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Reference jQuery in Master Page &lt;/strong&gt;
&lt;/p&gt;
&lt;pre class="hl"&gt; &lt;span class="hl sym"&gt;&amp;lt;%--&lt;/span&gt;Referencing javascript in a master
page maintaining intllisence&lt;span class="hl sym"&gt;--%&amp;gt;&lt;/span&gt; &lt;span class="hl sym"&gt;&amp;lt;%--&lt;/span&gt;Notice &lt;span class="hl str"&gt;'~'&lt;/span&gt; sign
in the script reference&lt;span class="hl sym"&gt;--%&amp;gt;&lt;/span&gt; &lt;span class="hl sym"&gt;&amp;lt;%&lt;/span&gt;&lt;span class="hl kwa"&gt;if&lt;/span&gt; &lt;span class="hl sym"&gt;(&lt;/span&gt; &lt;span class="hl kwa"&gt;false&lt;/span&gt; &lt;span class="hl sym"&gt;)
{ %&amp;gt;&lt;/span&gt; &lt;span class="hl sym"&gt;&amp;lt;&lt;/span&gt;script src&lt;span class="hl sym"&gt;=&lt;/span&gt;&lt;span class="hl str"&gt;&amp;quot;~/jQuery/js/jquery-1.3.2.min.js&amp;quot;&lt;/span&gt; type&lt;span class="hl sym"&gt;=&lt;/span&gt;&lt;span class="hl str"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class="hl sym"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;script&lt;span class="hl sym"&gt;&amp;gt;&lt;/span&gt; &lt;span class="hl sym"&gt;&amp;lt;%}
%&amp;gt;&lt;/span&gt; &lt;span class="hl sym"&gt;&amp;lt;&lt;/span&gt;script src&lt;span class="hl sym"&gt;=&amp;lt;%=&lt;/span&gt; &lt;span class="hl kwd"&gt;ResolveUrl&lt;/span&gt;&lt;span class="hl sym"&gt;(&lt;/span&gt;&lt;span class="hl str"&gt;&amp;quot;~/jQuery/js/jquery-1.3.2.min.js&amp;quot;&lt;/span&gt;&lt;span class="hl sym"&gt;)
%&amp;gt;&lt;/span&gt; type&lt;span class="hl sym"&gt;=&lt;/span&gt;&lt;span class="hl str"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt;&lt;span class="hl sym"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;script&lt;span class="hl sym"&gt;&amp;gt;&lt;/span&gt; &lt;span class="hl sym"&gt;&amp;lt;%--&lt;/span&gt;End&lt;span class="hl sym"&gt;--%&amp;gt;&lt;/span&gt;&lt;/pre&gt;</description>
      <comments>http://xealcom.co.uk/CommentView,guid,de47de14-6ddf-4828-b064-bb9b2f159839.aspx</comments>
      <category>Client Side</category>
    </item>
  </channel>
</rss>