Ask a Question related to ASP.NET General, Design and Development.
-
Todd Thompson #1
Re: Javascript in web user control
Anything that inherits from System.Web.UI.Control will have the read-only
UniqueID property. You can use that get automatically generated id's from
repeating things like DataList, DataGrid, Repeater, and presumably from your
own control.
HTH,
Todd Thompson
Todd Thompson Guest
-
using javascript in User controls to access server controls of the user control
Hello all, I have an asp.net textbox (named txtHidden) and an HtmlButton(named btnAction). I wanted to write a javascript function which will get... -
Passign Javascript From User Control to Parent(host) Page
Good Afternoon I am hoping for some help for a problem i am struggling with. I am using a Parent Page to Dynamically load my user Controls based... -
embeding Javascript src attribute in User control
I have a System.Web.UI.UserControl as custom control. I have a javascript block for user control. The problem is I want to bring src attribute from... -
can user control change its child control's property using javascript?
Hi, I place a menu on the user control, and want center the menu based upon client's screen resolution. I try to check the resolution using... -
how can i add client side javascript to a web user control?
hi, i have a web user control that i wish to add some client-side javascript to. something like this: onChange="javascript:DoSomething();" ... -
Christopher Young #2
Re: Javascript in web user control
Here is the HTML source for what I am trying.
When it creates the controls from the user control it
puts Test1:TextBox4 as the id. Is there a way to stop
this or what is the best way to grab that ID?
<script>function doadd()
{document.all.TextBox3.value= eval
(document.all.TextBox1.value) + eval
(document.all.TextBox2.value)}</script>
<script>function doadd2()
{document.all.TextBox6.value= eval
(document.all.TextBox4.value) + eval
(document.all.TextBox5.value)}</script>
<table>
<tr>
<td><p>
<input name="TextBox1" type="text" value="7"
id="TextBox1" /></p>
<p>
<input name="TextBox2" type="text" value="5"
id="TextBox2" /></p>
<p>
<input name="TextBox3" type="text" value="12"
id="TextBox3" /></p>
<p>
<input type="submit" name="Button1" value="Add"
id="Button1" onclick="doadd();return false;" /></p>
</td>
<td>
<P>
<input name="Test1:TextBox4" type="text"
value="7" id="Test1_TextBox4" /></P>
<P>
<input name="Test1:TextBox5" type="text"
value="7" id="Test1_TextBox5" /></P>
<P>
<input name="Test1:TextBox6" type="text"
id="Test1_TextBox6" /></P>
<P>
<input type="submit" name="Test1:Button2"
value="Add" id="Test1_Button2" onclick="doadd2();return
false;" /></P>
</td>
</tr>
</table>
>-----Original Message-----
>Actually correction, ClientID is the property you want.
>
>Todd Thompson
>.
>Christopher Young Guest



Reply With Quote

