Get Clientid
-
hi to all how can i get the client id in .net html source: <input type="button" id="button1" class="buttonsT" name="inputval30something^&()%#@!sabs" value="30 Something(1494)" title="Click this Button to log in as 30 Something(1494)" onclick="loginas('30something^&()%#@!sabs');"> this entirly bind in xslt..not in html
Known Is Drop.Unknown Is Ocean
-
hi to all how can i get the client id in .net html source: <input type="button" id="button1" class="buttonsT" name="inputval30something^&()%#@!sabs" value="30 Something(1494)" title="Click this Button to log in as 30 Something(1494)" onclick="loginas('30something^&()%#@!sabs');"> this entirly bind in xslt..not in html
Known Is Drop.Unknown Is Ocean
saravanan05 wrote:
how can i get the client id in .net
var id= document.getElementById(button1);
cheers, Abhijit CodeProject MVP
-
saravanan05 wrote:
how can i get the client id in .net
var id= document.getElementById(button1);
cheers, Abhijit CodeProject MVP
hi thanks for reply hidden field: <input name="hd1" id="hd1" type="hidden" /> jsscript: function test() { // document.forms.tstformfortavern.hd1.value=document.getElementById("button1"); document.getElementById("hd1").value=document.getElementById("button1").id; alert(document.getElementById("hd1").value); } i try get value in hdn.value in codebehind.but i didnt get value rs sara
Known Is Drop.Unknown Is Ocean
-
hi thanks for reply hidden field: <input name="hd1" id="hd1" type="hidden" /> jsscript: function test() { // document.forms.tstformfortavern.hd1.value=document.getElementById("button1"); document.getElementById("hd1").value=document.getElementById("button1").id; alert(document.getElementById("hd1").value); } i try get value in hdn.value in codebehind.but i didnt get value rs sara
Known Is Drop.Unknown Is Ocean
saravanan05 wrote:
i try get value in hdn.value in codebehind.but i didnt get value
What is hdn? Do you mean hd1? Your control is not marked as
runat=server
and how are you expecting to read it's value from code behind? :)Navaneeth How to use google | Ask smart questions
-
hi thanks for reply hidden field: <input name="hd1" id="hd1" type="hidden" /> jsscript: function test() { // document.forms.tstformfortavern.hd1.value=document.getElementById("button1"); document.getElementById("hd1").value=document.getElementById("button1").id; alert(document.getElementById("hd1").value); } i try get value in hdn.value in codebehind.but i didnt get value rs sara
Known Is Drop.Unknown Is Ocean
Make Hidden Field as Server Side Control Here is the java script script language="javascript" type="text/javascript"> var hdnid="<%= hdn.ClientID%>" function test() { var v= document.getElementById('btn1'); document.getElementById(hdnid).Value =v.value; alert( document.getElementById(hdnid).Value); } Now you can use hdn.value in codebehind also. cheers, Abhijit CodeProject MVP
-
Make Hidden Field as Server Side Control Here is the java script script language="javascript" type="text/javascript"> var hdnid="<%= hdn.ClientID%>" function test() { var v= document.getElementById('btn1'); document.getElementById(hdnid).Value =v.value; alert( document.getElementById(hdnid).Value); } Now you can use hdn.value in codebehind also. cheers, Abhijit CodeProject MVP
thanks for reply Abhijit For example: i get client id button1 in codebehind I need to set button back color using this button1 id.. Is this possible?
Known Is Drop.Unknown Is Ocean