M
Miguel Dias Moura
Hello,
I am having problems in accessing controls in my Asp.Net 2.0 pages.
I know Asp.Net 2.0 generates a ClientId.
In a Javascript function I tried to hide a panel as follows:
function ChangePanel()
{
document.getElementById("<%=Panel1.ClientID %>").style.display =
"block";
}
It is not working. I tried to check the code as follows:
function ChangePanel()
{
var PanelClientID = document.getElementById("<%=Panel1.ClientID
%>").style.display = "block";
alert("Client ID:" + PanelClientID)
}
I get Null.
If I place the code <%=Panel1.ClientID %> in my HTML code I get:
ctl00_MyContentPlaceHolder_Panel1
This was what I was expecting.
I think I am using "<%=Panel1.ClientID %>" wrong in my Javascript
function.
This is driving me crazy.
Could someone, please, help me out?
Thank You,
Miguel
I am having problems in accessing controls in my Asp.Net 2.0 pages.
I know Asp.Net 2.0 generates a ClientId.
In a Javascript function I tried to hide a panel as follows:
function ChangePanel()
{
document.getElementById("<%=Panel1.ClientID %>").style.display =
"block";
}
It is not working. I tried to check the code as follows:
function ChangePanel()
{
var PanelClientID = document.getElementById("<%=Panel1.ClientID
%>").style.display = "block";
alert("Client ID:" + PanelClientID)
}
I get Null.
If I place the code <%=Panel1.ClientID %> in my HTML code I get:
ctl00_MyContentPlaceHolder_Panel1
This was what I was expecting.
I think I am using "<%=Panel1.ClientID %>" wrong in my Javascript
function.
This is driving me crazy.
Could someone, please, help me out?
Thank You,
Miguel