<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Robust ASP.NET control referencing in JavaScript</title>
	<atom:link href="http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/</link>
	<description>ASP.NET and AJAX code, ideas, and examples.</description>
	<lastBuildDate>Sun, 14 Mar 2010 18:14:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Pedro Souki</title>
		<link>http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-36091</link>
		<dc:creator>Pedro Souki</dc:creator>
		<pubDate>Fri, 07 Aug 2009 22:17:00 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-36091</guid>
		<description>The function $get() is not a javascript function is a ajax asp.net one. It does the same of document.getElementById(), so to get value just do $get(&#039;elementID&#039;).value, but dont forget to put a scriptmanager in the top of the page for the ajax asp.net to work.</description>
		<content:encoded><![CDATA[<p>The function $get() is not a javascript function is a ajax asp.net one. It does the same of document.getElementById(), so to get value just do $get(&#8216;elementID&#8217;).value, but dont forget to put a scriptmanager in the top of the page for the ajax asp.net to work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: almny</title>
		<link>http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-35149</link>
		<dc:creator>almny</dc:creator>
		<pubDate>Wed, 29 Apr 2009 18:13:49 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-35149</guid>
		<description>thanks all for this useful information</description>
		<content:encoded><![CDATA[<p>thanks all for this useful information</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-34607</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Tue, 24 Mar 2009 13:45:57 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-34607</guid>
		<description>That works well, but you have to be careful with heavy use and/or use on large documents.  Because it has to run a substring search on every element on the page, it can often be surprisingly slow.</description>
		<content:encoded><![CDATA[<p>That works well, but you have to be careful with heavy use and/or use on large documents.  Because it has to run a substring search on every element on the page, it can often be surprisingly slow.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nath</title>
		<link>http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-34605</link>
		<dc:creator>nath</dc:creator>
		<pubDate>Tue, 24 Mar 2009 11:59:36 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-34605</guid>
		<description>If your using jquery the easiest way is to use the [attribute$=value] method - as Korayem pointed out - an example to get the aspx made link id, from your coded id:

//include jquery.js then:
$(document).ready(function(){$(&quot;a[id$=&#039;login_link&#039;]&quot;).click(function(event){tester(event,this)});});
function tester(event, el){
	event.preventDefault();
	alert($(el).attr(&quot;id&quot;));
}

//for element:
</description>
		<content:encoded><![CDATA[<p>If your using jquery the easiest way is to use the [attribute$=value] method &#8211; as Korayem pointed out &#8211; an example to get the aspx made link id, from your coded id:</p>
<p>//include jquery.js then:<br />
$(document).ready(function(){$(&#8220;a[id$='login_link']&#8220;).click(function(event){tester(event,this)});});<br />
function tester(event, el){<br />
	event.preventDefault();<br />
	alert($(el).attr(&#8220;id&#8221;));<br />
}</p>
<p>//for element:</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dani</title>
		<link>http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-34534</link>
		<dc:creator>dani</dc:creator>
		<pubDate>Tue, 17 Mar 2009 15:50:25 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-34534</guid>
		<description>This article uses a technique to resolve the client id:

http://www.codeproject.com/KB/aspnet/0g_asp_resolve_clientid.aspx</description>
		<content:encoded><![CDATA[<p>This article uses a technique to resolve the client id:</p>
<p><a href="http://www.codeproject.com/KB/aspnet/0g_asp_resolve_clientid.aspx" rel="nofollow">http://www.codeproject.com/KB/aspnet/0g_asp_resolve_clientid.aspx</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-34292</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Mon, 02 Mar 2009 14:46:53 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-34292</guid>
		<description>Not this specific technique.  There are several good workarounds in the comments above though.</description>
		<content:encoded><![CDATA[<p>Not this specific technique.  There are several good workarounds in the comments above though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-34283</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 02 Mar 2009 09:18:02 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-34283</guid>
		<description>Is there a way to make this working when you use a external .js file instead of inline js?

regards</description>
		<content:encoded><![CDATA[<p>Is there a way to make this working when you use a external .js file instead of inline js?</p>
<p>regards</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aashish Gupta</title>
		<link>http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-34003</link>
		<dc:creator>Aashish Gupta</dc:creator>
		<pubDate>Tue, 03 Feb 2009 02:38:10 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-34003</guid>
		<description>Sorry for $(&quot;#&quot;) in the first line actually i was trying to reference the grabbing of clientid in your previous comment but somehow i forgot to check that you have code formatting on your website.

Its actually &lt;pre lang=&quot;javascript&quot;&gt;$(&#039;#&#039;)&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Sorry for $(&#8220;#&#8221;) in the first line actually i was trying to reference the grabbing of clientid in your previous comment but somehow i forgot to check that you have code formatting on your website.</p>
<p>Its actually</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#'</span><span style="color: #009900;">&#41;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Aashish Gupta</title>
		<link>http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-34002</link>
		<dc:creator>Aashish Gupta</dc:creator>
		<pubDate>Tue, 03 Feb 2009 02:33:58 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-34002</guid>
		<description>Using $(&#039;#&#039;) always cries that control collection has been modified and this error drives me crazy.
Although the alternative is to replace = with # but somehow it doesnot work for me as i use my serverside includes in the head section only.

One hack which i found while researching on net is to write this statement with = sign just after your closing 
 and before  tag , i.e in between closing body and html tags.

If you can suggest some other good option for doing this then it would be great.

I dont want to go codebehind and do any registerclientscriptblock i think asp.net should allow this and it should not give this weired error.

Anyways all your post are great and the best on net in related topics.
Keep the good work going.</description>
		<content:encoded><![CDATA[<p>Using $(&#8216;#&#8217;) always cries that control collection has been modified and this error drives me crazy.<br />
Although the alternative is to replace = with # but somehow it doesnot work for me as i use my serverside includes in the head section only.</p>
<p>One hack which i found while researching on net is to write this statement with = sign just after your closing<br />
 and before  tag , i.e in between closing body and html tags.</p>
<p>If you can suggest some other good option for doing this then it would be great.</p>
<p>I dont want to go codebehind and do any registerclientscriptblock i think asp.net should allow this and it should not give this weired error.</p>
<p>Anyways all your post are great and the best on net in related topics.<br />
Keep the good work going.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-33092</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Tue, 04 Nov 2008 03:40:24 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-33092</guid>
		<description>&lt;pre lang=&quot;JavaScript&quot;&gt;$(&#039;#&lt;%= TextBox1.ClientID %&gt;&#039;)&lt;/pre&gt;</description>
		<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#&lt;%= TextBox1.ClientID %&gt;'</span><span style="color: #009900;">&#41;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: padam</title>
		<link>http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-33019</link>
		<dc:creator>padam</dc:creator>
		<pubDate>Sun, 02 Nov 2008 00:40:26 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-33019</guid>
		<description>how can i reference a asp:textbox inside wizard control using jquery,
ClientID is not working</description>
		<content:encoded><![CDATA[<p>how can i reference a asp:textbox inside wizard control using jquery,<br />
ClientID is not working</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-32749</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Thu, 23 Oct 2008 19:46:39 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-32749</guid>
		<description>There are several alternatives in the comments on this post.  

Since the JavaScript namespace is globally available, you can set ClientID variables in ASPX or output them from code behind, and still access them from a JS include.</description>
		<content:encoded><![CDATA[<p>There are several alternatives in the comments on this post.  </p>
<p>Since the JavaScript namespace is globally available, you can set ClientID variables in ASPX or output them from code behind, and still access them from a JS include.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vinay</title>
		<link>http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-32747</link>
		<dc:creator>vinay</dc:creator>
		<pubDate>Thu, 23 Oct 2008 19:24:41 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-32747</guid>
		<description>We can&#039;t use this &quot;&quot; in .js file ?
any solution for this ?</description>
		<content:encoded><![CDATA[<p>We can&#8217;t use this &#8220;&#8221; in .js file ?<br />
any solution for this ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-31708</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Fri, 25 Jul 2008 12:59:02 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-31708</guid>
		<description>It works the same way from a content page.

The only situation I&#039;m aware of where it doesn&#039;t work is for controls in a repeated ITemplate.</description>
		<content:encoded><![CDATA[<p>It works the same way from a content page.</p>
<p>The only situation I&#8217;m aware of where it doesn&#8217;t work is for controls in a repeated ITemplate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Naresh</title>
		<link>http://encosia.com/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-31705</link>
		<dc:creator>Naresh</dc:creator>
		<pubDate>Fri, 25 Jul 2008 12:50:32 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-31705</guid>
		<description>ok..this will work if we use a single webpage. if the page in masterpage then how to identify the control.</description>
		<content:encoded><![CDATA[<p>ok..this will work if we use a single webpage. if the page in masterpage then how to identify the control.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
