PDA

View Full Version : Running Javascript and ASP



duke_1222
10-19-2006, 11:25 PM
I want to run some javascript code and then some ASP.NEt code.
I can do both function seperately by pressing two different objects. But I cannot to then off one object. :confused:


Below I have:

> An image which when I click runs a javascript function.
> A button which does the ASP processing.

I want to run both the javascript and ASP off a single click of the ASP button (btnsub_Click).



<%@ Page Language="VB" %>
<script runat="server">

Sub btnsub_Click(ByVal Sender As Object, ByVal E As EventArgs)

If Page.IsValid Then
' Do Something

End If
End Sub
</script>

<html>
<head><script type="text/javascript">
javafunction() etc.. etc..
</script>
</head>

<a onclick="javafunction()"><img src="graphic.gif" /></a>

<asp:button id="btnsub" text="Submit" onClick="btnsub_Click" runat="server" />





__

Does anyone know I can add "javafunction()" to the button click code?


Would appreciate any help.

Thanks