<%
sub cmdSave_onClick()
if something then
Response.write "<script language=""javascript"">openPopWindow(xx,xx,xx);</script>"
end if
end sub
%>
All you have to do is drop a button design-time-control (DTC) on your ASP, call it cmdSave, and the proper subroutine for the click event is:
<%
sub cmdSave_onClick()
do something
end sub
%>
If you do a response.Redirect in the subroutine, make sure to put the sub at the top of your page above the first <html> tag, otherwise the page will start writing to the browser before the redirect hits, and you will get an error.
I use the same structure with DTC listboxes optiongroups, etc:
<%
sub listbox_onChange()
do something else
end sub
%>
Here is an example of client side event trigger...
U need to add some asp coding where u need to do that from server side...
<HTML>
<HEAD>
<SCRIPT>
function fnFireEvents()
{
oDiv.innerText = "The cursor has moved over me!";
oButton.fireEvent("onclick"
}
</SCRIPT>
</HEAD>
<BODY>
<h1>Using the fireEvent method</h1>
By moving the cursor over the DIV below, the button is clicked.
<P>
<DIV ID="oDiv" onmouseover="fnFireEvents();">
Mouse over this!
</DIV>
<p>
<BUTTON ID="oButton" ONCLICK="this.innerText='I have been clicked!'" >
Button</BUTTON>
</BODY>
</HTML>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.