<?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: User Controls and javascript</title>
	<atom:link href="http://benreichelt.net/blog/2004/12/21/user-controls-and-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://benreichelt.net/blog/2004/12/21/user-controls-and-javascript/</link>
	<description></description>
	<lastBuildDate>Tue, 18 Aug 2009 22:20:45 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: ben</title>
		<link>http://benreichelt.net/blog/2004/12/21/user-controls-and-javascript/comment-page-1/#comment-1095</link>
		<dc:creator>ben</dc:creator>
		<pubDate>Wed, 21 May 2008 13:19:12 +0000</pubDate>
		<guid isPermaLink="false">http://s194721765.onlinehome.us/blog/2004/12/21/user-controls-and-javascript/#comment-1095</guid>
		<description>Ha! it&#039;s actually over 3 years old :)  At some point along the way I found out about Control.ClientId too, it makes life a lot easier.</description>
		<content:encoded><![CDATA[<p>Ha! it&#8217;s actually over 3 years old <img src='http://benreichelt.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   At some point along the way I found out about Control.ClientId too, it makes life a lot easier.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: harterc2</title>
		<link>http://benreichelt.net/blog/2004/12/21/user-controls-and-javascript/comment-page-1/#comment-1094</link>
		<dc:creator>harterc2</dc:creator>
		<pubDate>Wed, 21 May 2008 13:13:05 +0000</pubDate>
		<guid isPermaLink="false">http://s194721765.onlinehome.us/blog/2004/12/21/user-controls-and-javascript/#comment-1094</guid>
		<description>I just realized that post is from over 2 years ago.  :(</description>
		<content:encoded><![CDATA[<p>I just realized that post is from over 2 years ago.  <img src='http://benreichelt.net/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: harterc2</title>
		<link>http://benreichelt.net/blog/2004/12/21/user-controls-and-javascript/comment-page-1/#comment-1093</link>
		<dc:creator>harterc2</dc:creator>
		<pubDate>Wed, 21 May 2008 13:12:05 +0000</pubDate>
		<guid isPermaLink="false">http://s194721765.onlinehome.us/blog/2004/12/21/user-controls-and-javascript/#comment-1093</guid>
		<description>Try.. something like this..

protected System.Web.UI.WebControls.Button MyButton;


protected void Page_Load(object sender, EventArgs e)
{
   MyButton.Attributes.Add(&quot;onclick&quot;, &quot;javascript:AccessTextbox(&quot;    txtYourTextBox.ClientID   
   &quot;)&quot;);
}

// the onclick event will trigger that javascript function and you&#039;ll already have your textbox&#039;s clientID (the real ID) as a parameter passed to the function.
// Hope that helped atleast somewhat</description>
		<content:encoded><![CDATA[<p>Try.. something like this..</p>
<p>protected System.Web.UI.WebControls.Button MyButton;</p>
<p>protected void Page_Load(object sender, EventArgs e)<br />
{<br />
   MyButton.Attributes.Add(&#8221;onclick&#8221;, &#8220;javascript:AccessTextbox(&#8221;    txtYourTextBox.ClientID<br />
   &#8220;)&#8221;);<br />
}</p>
<p>// the onclick event will trigger that javascript function and you&#8217;ll already have your textbox&#8217;s clientID (the real ID) as a parameter passed to the function.<br />
// Hope that helped atleast somewhat</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://benreichelt.net/blog/2004/12/21/user-controls-and-javascript/comment-page-1/#comment-153</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 05 Jul 2005 08:21:22 +0000</pubDate>
		<guid isPermaLink="false">http://s194721765.onlinehome.us/blog/2004/12/21/user-controls-and-javascript/#comment-153</guid>
		<description>how can i access the textbox of a user control inside control using javascript??</description>
		<content:encoded><![CDATA[<p>how can i access the textbox of a user control inside control using javascript??</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://benreichelt.net/blog/2004/12/21/user-controls-and-javascript/comment-page-1/#comment-152</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Wed, 22 Dec 2004 02:24:00 +0000</pubDate>
		<guid isPermaLink="false">http://s194721765.onlinehome.us/blog/2004/12/21/user-controls-and-javascript/#comment-152</guid>
		<description>One thing I have been doing lately is to use the DOM to traverse form elements, that way I only need a reference to the table or div that contains all of the input boxes, etc..</description>
		<content:encoded><![CDATA[<p>One thing I have been doing lately is to use the DOM to traverse form elements, that way I only need a reference to the table or div that contains all of the input boxes, etc..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://benreichelt.net/blog/2004/12/21/user-controls-and-javascript/comment-page-1/#comment-151</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 21 Dec 2004 18:45:00 +0000</pubDate>
		<guid isPermaLink="false">http://s194721765.onlinehome.us/blog/2004/12/21/user-controls-and-javascript/#comment-151</guid>
		<description>To agree what Scott and Paul said, I *never* assume the client ID, even if I&#039;m pretty darn sure (99.9%)... I&#039;ll always use the ClientID property.</description>
		<content:encoded><![CDATA[<p>To agree what Scott and Paul said, I *never* assume the client ID, even if I&#8217;m pretty darn sure (99.9%)&#8230; I&#8217;ll always use the ClientID property.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://benreichelt.net/blog/2004/12/21/user-controls-and-javascript/comment-page-1/#comment-150</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 21 Dec 2004 07:57:00 +0000</pubDate>
		<guid isPermaLink="false">http://s194721765.onlinehome.us/blog/2004/12/21/user-controls-and-javascript/#comment-150</guid>
		<description>I had thought about duplicate names and ids, but I didn&#039;t think that was a good enough reason, it should be up to the developer to make sure they name their elements distinctly. &lt;br&gt;&lt;br&gt;However, I had not considered using a user control multiple times on a page, in that case the developer simply cannot make distinct names, so in this case the behavior is warranted, good answer, thanks</description>
		<content:encoded><![CDATA[<p>I had thought about duplicate names and ids, but I didn&#8217;t think that was a good enough reason, it should be up to the developer to make sure they name their elements distinctly. </p>
<p>However, I had not considered using a user control multiple times on a page, in that case the developer simply cannot make distinct names, so in this case the behavior is warranted, good answer, thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://benreichelt.net/blog/2004/12/21/user-controls-and-javascript/comment-page-1/#comment-149</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 21 Dec 2004 07:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://s194721765.onlinehome.us/blog/2004/12/21/user-controls-and-javascript/#comment-149</guid>
		<description>Why?  Because you can use a user control multiple times in the same page -- but the ids and names have to be guaranteed unique on the page.</description>
		<content:encoded><![CDATA[<p>Why?  Because you can use a user control multiple times in the same page &#8212; but the ids and names have to be guaranteed unique on the page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://benreichelt.net/blog/2004/12/21/user-controls-and-javascript/comment-page-1/#comment-148</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Tue, 21 Dec 2004 07:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://s194721765.onlinehome.us/blog/2004/12/21/user-controls-and-javascript/#comment-148</guid>
		<description>Use the ClientId property of the control - this will give you the unique name you can use to refer to the control client-side. It is necessary to ensure unique names for the elements for Javascript. It&#039;s still there in ASP.NET 2.0</description>
		<content:encoded><![CDATA[<p>Use the ClientId property of the control &#8211; this will give you the unique name you can use to refer to the control client-side. It is necessary to ensure unique names for the elements for Javascript. It&#8217;s still there in ASP.NET 2.0</p>
]]></content:encoded>
	</item>
</channel>
</rss>
