Masterpage and postback

  • Thread starter Thread starter Joseph James
  • Start date Start date
J

Joseph James

Hi all,
I am very new to ASP.net. As I was going through new features of asp.net, I came across Masterpage and I tried to use it. But when I tried to access a control from client side java script (for postback purpose), I found that the controls name was changed (appended with ctl00_ContentPlaceHolder1_). Is there any way to find out the client name of the control at runtime dynamically?

Thanks in advance
 
Yes, you want to use Control.ClientID in your javascript. So perhaps this:

<script>
function DoSomething()
{
document.findElementById('<%= myServerLabel.ClientID %>').innherHtml = "something";
}
</script>

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
Back
Top