html controls access on server side??
-
Hi, How do I access an HTML control on my aspx's load event(code behind)? I've added a runat='server' to the control, but that buggers up my access to the control in javascript. What do I do?
Regards, Tintin
-
Hi, How do I access an HTML control on my aspx's load event(code behind)? I've added a runat='server' to the control, but that buggers up my access to the control in javascript. What do I do?
Regards, Tintin
-
You just need to provide the runat and the id attbutes to access the html control in codebehind.
Best Regards, Apurva Kaushal
if i add the runat attribute, document.getElementById('imgPic').src doesnt work anymore because the id tag changes to cl00_imgPic. And I cant get it to work with getElementByName.
Regards, Tintin
-
if i add the runat attribute, document.getElementById('imgPic').src doesnt work anymore because the id tag changes to cl00_imgPic. And I cant get it to work with getElementByName.
Regards, Tintin
-
You just need to provide the runat and the id attbutes to access the html control in codebehind.
Best Regards, Apurva Kaushal
sorry. document.getElementbyID im my Javascript (client side)
Regards, Tintin
-
where is the control placed in the webform? Are you using that inside of any other control.
Best Regards, Apurva Kaushal
Regards, Tintin
-
Regards, Tintin
-
sorry. document.getElementbyID im my Javascript (client side)
Regards, Tintin
-
Hi, How do I access an HTML control on my aspx's load event(code behind)? I've added a runat='server' to the control, but that buggers up my access to the control in javascript. What do I do?
Regards, Tintin
-
You can access that both in javascript and in code behind after putting ID and runat=server.
Best Regards, Apurva Kaushal
tnx, seems to be working now.
Regards, Tintin
-
tnx, seems to be working now.
Regards, Tintin
-
Hi, How do I access an HTML control on my aspx's load event(code behind)? I've added a runat='server' to the control, but that buggers up my access to the control in javascript. What do I do?
Regards, Tintin
You can use the clientID property of the control on the server side to output the correct ID for the javascript function. Just output it in some script to the page as a var or something...
-
if i add the runat attribute, document.getElementById('imgPic').src doesnt work anymore because the id tag changes to cl00_imgPic. And I cant get it to work with getElementByName.
Regards, Tintin
if u set the html controls in the reapter,datalist etc.. the htmlcontrols or webcontrols will be add some words like "ctl00" before the html id