A
Alex
I can successfully use <%=myControl.ClientID%> inside of a Javascript
function, but does anyone know if it is possible to pass this value to
my Javascript function? The reason I want to do this is so I can
abstract my Javascript function out of my ASP.NET user control.
Ideally, I would like to have a function like this.
function testMe(control){
document.getElementByID(control).style = ...
// do more useful things here
// I am trying not to have to use this...
// document.getElementByID('<%=btnTest.ClientID%>').style = ...
}
I would like to be able to call it like this...
<asp:LinkButton id="btnTest" runat="server" OnClientClick="return
testMe(<%=this.ClientID%>)" text="test" />
But this does not work. If I have to keep the actual control name in
the javascript file, then my decoupling is lost. Is this approach
possible?
Thanks.
function, but does anyone know if it is possible to pass this value to
my Javascript function? The reason I want to do this is so I can
abstract my Javascript function out of my ASP.NET user control.
Ideally, I would like to have a function like this.
function testMe(control){
document.getElementByID(control).style = ...
// do more useful things here
// I am trying not to have to use this...
// document.getElementByID('<%=btnTest.ClientID%>').style = ...
}
I would like to be able to call it like this...
<asp:LinkButton id="btnTest" runat="server" OnClientClick="return
testMe(<%=this.ClientID%>)" text="test" />
But this does not work. If I have to keep the actual control name in
the javascript file, then my decoupling is lost. Is this approach
possible?
Thanks.