M
Miguel Dias Moura
Hello,
I have been trying, for days, to retrieve a control's ClientId in a
javascript function.
I am using a master page and this is why I need to retrieve the
Control's ClientId.
The control Id is "Panel1". I placed "<%=Panel1.ClientID %>" in my HTML
code and I got "ctl00_pPanel1".
In my Javascript function I am using:
document.getElementById("<%=Panel1.ClientID %>").style.display =
"block";
This is not working. I also tried a hidden field but I wasn't able to
make this work.
I am including my Javascript code on Page_Init as follows:
' Include page's javascript file
If Not Page.ClientScript.IsClientScriptIncludeRegistered("MyCode")
Then
Page.ClientScript.RegisterClientScriptInclude("MyCode",
"/Scripts/MyCode.js")
End If
This is driving me crazy. I read some information on MSDN library but I
can't figure out what I am doing wrong.
Could someone tell me how to make this work?
I am using Asp.Net 2.0.
Thank You Very Much,
Miguel
I have been trying, for days, to retrieve a control's ClientId in a
javascript function.
I am using a master page and this is why I need to retrieve the
Control's ClientId.
The control Id is "Panel1". I placed "<%=Panel1.ClientID %>" in my HTML
code and I got "ctl00_pPanel1".
In my Javascript function I am using:
document.getElementById("<%=Panel1.ClientID %>").style.display =
"block";
This is not working. I also tried a hidden field but I wasn't able to
make this work.
I am including my Javascript code on Page_Init as follows:
' Include page's javascript file
If Not Page.ClientScript.IsClientScriptIncludeRegistered("MyCode")
Then
Page.ClientScript.RegisterClientScriptInclude("MyCode",
"/Scripts/MyCode.js")
End If
This is driving me crazy. I read some information on MSDN library but I
can't figure out what I am doing wrong.
Could someone tell me how to make this work?
I am using Asp.Net 2.0.
Thank You Very Much,
Miguel