<?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/robust-aspnet-control-referencing-in-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://encosia.com/robust-aspnet-control-referencing-in-javascript/</link>
	<description>ASP.NET and AJAX code, ideas, and examples.</description>
	<lastBuildDate>Wed, 16 May 2012 23:02:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Jason Hardesty</title>
		<link>http://encosia.com/robust-aspnet-control-referencing-in-javascript/#comment-43398</link>
		<dc:creator>Jason Hardesty</dc:creator>
		<pubDate>Fri, 20 May 2011 19:06:08 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-43398</guid>
		<description>I have controls that are created at runtime. How can I get the clientID? 

Can I use/how do I use to get the value of a required field validator:

&lt;pre lang=&quot;javascript&quot;&gt;$(&quot;[id$=_mycontrolid]&quot;)&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>I have controls that are created at runtime. How can I get the clientID? </p>
<p>Can I use/how do I use to get the value of a required field validator:</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;">&quot;[id$=_mycontrolid]&quot;</span><span style="color: #009900;">&#41;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/robust-aspnet-control-referencing-in-javascript/#comment-42526</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Wed, 16 Mar 2011 20:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-42526</guid>
		<description>I think it has some interesting ideas, but it&#039;s not something I&#039;m interested in using myself.  I think it relies on the assumption that you &lt;em&gt;like&lt;/em&gt; things like the page lifecycle and server controls, which I don&#039;t.</description>
		<content:encoded><![CDATA[<p>I think it has some interesting ideas, but it&#8217;s not something I&#8217;m interested in using myself.  I think it relies on the assumption that you <em>like</em> things like the page lifecycle and server controls, which I don&#8217;t.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alkos333</title>
		<link>http://encosia.com/robust-aspnet-control-referencing-in-javascript/#comment-42525</link>
		<dc:creator>alkos333</dc:creator>
		<pubDate>Wed, 16 Mar 2011 19:06:54 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-42525</guid>
		<description>Yes, Razor is a thing of beauty - loving the templating concept w/o the need explicitly indicate server-side code. 

What are you thoughts on ASP.NET WebForms MVP: http://webformsmvp.com/ (way down there..)</description>
		<content:encoded><![CDATA[<p>Yes, Razor is a thing of beauty &#8211; loving the templating concept w/o the need explicitly indicate server-side code. </p>
<p>What are you thoughts on ASP.NET WebForms MVP: <a href="http://webformsmvp.com/" rel="nofollow">http://webformsmvp.com/</a> (way down there..)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/robust-aspnet-control-referencing-in-javascript/#comment-42524</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Wed, 16 Mar 2011 18:48:47 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-42524</guid>
		<description>I&#039;m able to make do with either ASP.NET WebForms or ASP.NET MVC, if I have the freedom to use them how I desire.  Whether it&#039;s an ASMX endpoint or an MVC controller action, I&#039;ll work with anything that can send and receive JSON effectively.  On the backend of either, working with the view models and business logic is almost identical.

I do like the Razor view engine a lot though.

(looks like we&#039;re at the bottom now)</description>
		<content:encoded><![CDATA[<p>I&#8217;m able to make do with either ASP.NET WebForms or ASP.NET MVC, if I have the freedom to use them how I desire.  Whether it&#8217;s an ASMX endpoint or an MVC controller action, I&#8217;ll work with anything that can send and receive JSON effectively.  On the backend of either, working with the view models and business logic is almost identical.</p>
<p>I do like the Razor view engine a lot though.</p>
<p>(looks like we&#8217;re at the bottom now)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alkos333</title>
		<link>http://encosia.com/robust-aspnet-control-referencing-in-javascript/#comment-42523</link>
		<dc:creator>alkos333</dc:creator>
		<pubDate>Wed, 16 Mar 2011 18:44:23 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-42523</guid>
		<description>So I am assuming you are a huge proponent of MVC then :)?  (it&#039;s closing in)</description>
		<content:encoded><![CDATA[<p>So I am assuming you are a huge proponent of MVC then :)?  (it&#8217;s closing in)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/robust-aspnet-control-referencing-in-javascript/#comment-42522</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Wed, 16 Mar 2011 18:41:40 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-42522</guid>
		<description>Often, the only way to wean legacy projects off the old WebForms model is slowly, over time.  In those situations, it&#039;s helpful to be able to transition to approaches like using jQuery Validation and using jQuery to interact with services, while remaining within the confines of WebForms and the single-form-per-page model that it imposes.  Otherwise, the choice becomes one between an entire rewrite or just adding new functionality the old way, and the rewrite rarely wins there. (pretty narrow!)</description>
		<content:encoded><![CDATA[<p>Often, the only way to wean legacy projects off the old WebForms model is slowly, over time.  In those situations, it&#8217;s helpful to be able to transition to approaches like using jQuery Validation and using jQuery to interact with services, while remaining within the confines of WebForms and the single-form-per-page model that it imposes.  Otherwise, the choice becomes one between an entire rewrite or just adding new functionality the old way, and the rewrite rarely wins there. (pretty narrow!)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alkos333</title>
		<link>http://encosia.com/robust-aspnet-control-referencing-in-javascript/#comment-42521</link>
		<dc:creator>alkos333</dc:creator>
		<pubDate>Wed, 16 Mar 2011 18:02:12 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-42521</guid>
		<description>Meaning? ... ( hmm.. just how narrow can this threading window get w/ so many posts)</description>
		<content:encoded><![CDATA[<p>Meaning? &#8230; ( hmm.. just how narrow can this threading window get w/ so many posts)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/robust-aspnet-control-referencing-in-javascript/#comment-42520</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Wed, 16 Mar 2011 18:00:13 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-42520</guid>
		<description>One step at a time.</description>
		<content:encoded><![CDATA[<p>One step at a time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alkos333</title>
		<link>http://encosia.com/robust-aspnet-control-referencing-in-javascript/#comment-42519</link>
		<dc:creator>alkos333</dc:creator>
		<pubDate>Wed, 16 Mar 2011 17:56:19 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-42519</guid>
		<description>That is true - you have to go all in to take the full advantage. But Dave, majority of the posts on this blog deal with how to have jQuery play nicely with ASP.NET.  A perfect example is validation plug-in and validation group posts.  If you are fully embracing here, why not use ASP.NET&#039;s validation controls :)?</description>
		<content:encoded><![CDATA[<p>That is true &#8211; you have to go all in to take the full advantage. But Dave, majority of the posts on this blog deal with how to have jQuery play nicely with ASP.NET.  A perfect example is validation plug-in and validation group posts.  If you are fully embracing here, why not use ASP.NET&#8217;s validation controls :)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/robust-aspnet-control-referencing-in-javascript/#comment-42518</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Wed, 16 Mar 2011 17:51:57 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-42518</guid>
		<description>I think the key is to either fully embrace the ASP.NET server control approach or fully avoid it.  Trying to do half and half is tough.</description>
		<content:encoded><![CDATA[<p>I think the key is to either fully embrace the ASP.NET server control approach or fully avoid it.  Trying to do half and half is tough.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alkos333</title>
		<link>http://encosia.com/robust-aspnet-control-referencing-in-javascript/#comment-42517</link>
		<dc:creator>alkos333</dc:creator>
		<pubDate>Wed, 16 Mar 2011 17:47:53 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-42517</guid>
		<description>I should add that I really enjoy the server-side programming in C# for example - it&#039;s just writing pure client side code for a ASP.NET 4 can be such a pita sometimes.</description>
		<content:encoded><![CDATA[<p>I should add that I really enjoy the server-side programming in C# for example &#8211; it&#8217;s just writing pure client side code for a ASP.NET 4 can be such a pita sometimes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alkos333</title>
		<link>http://encosia.com/robust-aspnet-control-referencing-in-javascript/#comment-42516</link>
		<dc:creator>alkos333</dc:creator>
		<pubDate>Wed, 16 Mar 2011 17:46:15 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-42516</guid>
		<description>That is what I do to mitigate the issue - I rather take a performance hit than globally define variables for every possible element I&#039;ll be using in the user control.  That&#039;s just seems like such a maintenance nightmare to me.

After a few years of ASP.NET now, it feels like a one big hack after all.  Working on a project in PHP recently felt like a breath of fresh air - so clean and elegant.</description>
		<content:encoded><![CDATA[<p>That is what I do to mitigate the issue &#8211; I rather take a performance hit than globally define variables for every possible element I&#8217;ll be using in the user control.  That&#8217;s just seems like such a maintenance nightmare to me.</p>
<p>After a few years of ASP.NET now, it feels like a one big hack after all.  Working on a project in PHP recently felt like a breath of fresh air &#8211; so clean and elegant.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave Ward</title>
		<link>http://encosia.com/robust-aspnet-control-referencing-in-javascript/#comment-42515</link>
		<dc:creator>Dave Ward</dc:creator>
		<pubDate>Wed, 16 Mar 2011 17:40:30 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-42515</guid>
		<description>One important thing to keep in mind when using that &quot;ends with&quot; selector is that it&#039;s one of the slowest possible selectors.  Each time it appears, you&#039;re asking jQuery to loop through every DOM element on the page and execute a substring comparison (&lt;em&gt;every&lt;/em&gt; DOM element - even after a first match is located).

If you know the type of element you&#039;re searching for, you can use that to mitigate the problem a bit, e.g.:

&lt;pre lang=&quot;javascript&quot;&gt;$(&#039;a[id$=yourLinkButtonID]&#039;)&lt;/pre&gt;

Then, at least you narrow the search down to all of a particular element type on the page, which jQuery can quickly retrieve with a getElementsByTagName().</description>
		<content:encoded><![CDATA[<p>One important thing to keep in mind when using that &#8220;ends with&#8221; selector is that it&#8217;s one of the slowest possible selectors.  Each time it appears, you&#8217;re asking jQuery to loop through every DOM element on the page and execute a substring comparison (<em>every</em> DOM element &#8211; even after a first match is located).</p>
<p>If you know the type of element you&#8217;re searching for, you can use that to mitigate the problem a bit, e.g.:</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;">'a[id$=yourLinkButtonID]'</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>Then, at least you narrow the search down to all of a particular element type on the page, which jQuery can quickly retrieve with a getElementsByTagName().</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alkos333</title>
		<link>http://encosia.com/robust-aspnet-control-referencing-in-javascript/#comment-42514</link>
		<dc:creator>alkos333</dc:creator>
		<pubDate>Wed, 16 Mar 2011 17:37:57 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-42514</guid>
		<description>The only problem with static client IDs is potential clashes when writing for a bigger existing system. For example, when you are writing a module for a content management system which was implemented with WebForms,  you might have a number of various content parts with various names, so you need to use either  AutoID or Predictable modes to avoid clashes since there is only one .  What a big freaking joke...</description>
		<content:encoded><![CDATA[<p>The only problem with static client IDs is potential clashes when writing for a bigger existing system. For example, when you are writing a module for a content management system which was implemented with WebForms,  you might have a number of various content parts with various names, so you need to use either  AutoID or Predictable modes to avoid clashes since there is only one .  What a big freaking joke&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cchitsiang</title>
		<link>http://encosia.com/robust-aspnet-control-referencing-in-javascript/#comment-42513</link>
		<dc:creator>cchitsiang</dc:creator>
		<pubDate>Wed, 16 Mar 2011 17:31:30 +0000</pubDate>
		<guid isPermaLink="false">http://encosia.com/index.php/2007/08/08/robust-aspnet-control-referencing-in-javascript/#comment-42513</guid>
		<description>Yes, i believe that will be easier too..and I using that too :)</description>
		<content:encoded><![CDATA[<p>Yes, i believe that will be easier too..and I using that too :)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

