How to call an ASP.NET Subroutine from a javascript function
I want to call a subroutine from a javascript function. How can I do it? I am trying to do it thus: (But it doesn’ t work)
Client side code (javascript)
Code:
function check_State(eventTarget, eventArgument) {
if (document.form_newOffer.states.value != "0") {
var theform;
theform = document.form_newOffer;
}
theform.submit();
}
}
The form control that triggers the js function:
Code:
<asp:dropdownlist ID="product" onChange="check_State(' Certificates ','')" runat="server" CssClass="letter1"></asp:dropdownlist>
And a piece of the Subroutine:
Code:
Sub Certificates(sender As Object, E As EventArgs)
If states.SelectedItem.Value <> "0" Then
Dim CmdCert AS New SqlCommand("sel_CertAuto", strConnection)
CmdCert.CommandType = CommandType.StoredProcedure
...
Thank you,
Cesar
Re: How to call an ASP.NET Subroutine from a javascript function
use your script on a list with AutoPostback=false(or an html list) and use this to fire your postback when it is needed
http://vbforums.com/showthread.php?t=329597