my problem is that I have a form in ASP.NET in VB and I have events declared in that program, now I need to know how to execute those events from javascript. visual event
Protected Sub Cargar()
PanelSearch.Visible = False
End Sub
javascript:
Function CargarDatos(){
document.getElementById("Button1").click();
};
The javascript code works for me but only when the "button1 is visible and as you can see I need to hide it, and when I hide it it no longer works. And it has to be that way because I need it to work with the javascript. Thanks for your time.
When you want to get the ASP tags in Javascript you must use ClientIDs:
<%=IDVariable.ClientID%>
Example:ASP
JAVA SCRIPT
Another option to call a Javascript function from an ASP Button is to use the onclientclick method.