views:

675

answers:

4

I'm new to .Net and JQuery and are trying to access a textbox through jquery but can't get it to work, can someone help?

+2  A: 

ASP.NET breaks your client ids - Microsoft not complient! Have you access ClientID store?

var textboxclientid = '<%=textbox.ClientID%>';
$('#' + textboxclientid).val('horray');
premium_mesg_dev
Thanks - that helped
+1  A: 
$("#your_textboxID");

Check this link

rahul
A: 

Give your Textbox a unique css class then use `$('.classname').val(). This way you don't need to do inline coding like '<%=textbox.ClientID%>'.

IMHO a cleaner solution....

Colin
A unique css class... you clearly meant id.
SeanJA
by a unique css class i meant a css class only used by this control, i.e. a marker class.
Colin
A: 

$("#TextBox1").val("Result");

Ramani Sandeep