Hi,
The panel id tag is ctl00_MyContentPlaceHolder_Panel1.
When I view the source I see the include line that includes the
javascript file. I am using the following line to load the javascript
file at runtime in the Page_Init:
' Define and include javascript file
Dim name As String = "Inscricao"
Dim url As String = "Assets/Javascript/Subs.js"
Dim type As Type = Me.GetType()
' Get a ClientScriptManager reference from the Page class
Dim reference As ClientScriptManager = Page.ClientScript
' Check if the include script is already registered
If (Not reference.IsClientScriptIncludeRegistered(type, name)) Then
' Include javascript file
reference.RegisterClientScriptInclude(type, name, url)
End If
However I call the javascript function only when a dropdownlist is
changed.
I can't figure what the problem is.
Thanks,
Miguel
"Bruce Barker" <br******************@safeco.com> wrote in message
news:OQ*************@TK2MSFTNGP10.phx.gbl:
when you view source what does your javascript look like? also looking at
the source, what is the panels actual id tag?
-- bruce (sqlwork.com)
"Miguel Dias Moura" <md*REMOVE*moura@gmail*NOSPAM*.com> wrote in message
news:uN**************@tk2msftngp13.phx.gbl...
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