Link to home
Create AccountLog in
Avatar of Wigging
WiggingFlag for United States of America

asked on

call vb.net sub from javascript?

I have that code below.....it returns values from other page.......is there a way i can call a vb.net sub based on conditions.
that sub below has to be called if a condition in  function OnClientClose(oWnd, args) is met..

  Sub shipinvoice()
        Dim strConn2 As String = ConfigurationManager.ConnectionStrings("connectionUSSL").ConnectionString
        Dim conn2 As New SqlConnection(strConn2)
        Try
            conn2.Open()
            Dim cmd2 As New Data.SqlClient.SqlCommand("wmResharpShipInvoiceCoSp", conn2)
            cmd2.CommandType = CommandType.StoredProcedure
            cmd2.Parameters.Add("@co_num", SqlDbType.NVarChar).Value = Session("coNum")
            cmd2.Parameters.Add("@PWhse", SqlDbType.NVarChar).Value = Session("coNum")
            cmd2.Parameters.Add("@infobar", SqlDbType.NVarChar, 2800).Direction = ParameterDirection.Output
            Dim dr As Data.SqlClient.SqlDataReader = Nothing
            dr = cmd2.ExecuteReader()
        Catch ex As Exception
            c1.handleError("shipinvoice", ex.Message, "")
        Finally
            conn2.Close()
            conn2.Dispose()
        End Try
    End Sub
function OnClientClose(oWnd, args)
        {
            //get the transferred arguments
            var arg = args.get_argument();
            if (arg)
            {
                var cityName = arg.cityName;
                var seldate = arg.selDate;
                $get("order").innerHTML = "You chose to fly to <strong>" + cityName + "</strong> on <strong>" + seldate + "</strong>";
            }

Open in new window

Avatar of ajb2222
ajb2222

The  way I do this is to have a hidden asp:button on the form that I can click from the java.

Avatar of Wigging

ASKER

could you elaborate a lil more?  
Avatar of Wigging

ASKER

or an example?
ASKER CERTIFIED SOLUTION
Avatar of ajb2222
ajb2222

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account