Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pagemethod OnSuccess event not firing

Status
Not open for further replies.

tekkerguy

Programmer
Nov 16, 2005
196
US
My Pagemethod fires c# code which submits a record to a database, this is working.

But I have some js code stored in an onsuccess method, which should alert that the record was submitted, but it's not firing.

Here's the js: (the data gathering part of the js code is omitted, it's not necessary)

Code:
function submitfunction()
{
    if (doSubmit == false)
    {
    alert("The Following items need a value: \n \n" + errorList);
    
    }
    else
    {
        PageMethods.submitForm(pagewoTable, pagecfTable, OnSubmitComplete, OnManuFailed); 
    } 

}



function OnSubmitComplete(results) 
{
debugger;
    alert("Crane Saved Successfully");
    //window.close();
}

/* Failed Manufacturer Load */
function OnManuFailed(error)
{
    //debugger;
     alert("Stack Trace: " + error.get_stackTrace() + "/r/n" +
          "Error: " + error.get_message() + "/r/n" +
          "Status Code: " + error.get_statusCode() + "/r/n" +
          "Exception Type: " + error.get_exceptionType() + "/r/n" +
          "Timed Out: " + error.get_timedOut());
}


and here is the cs code:


Code:
        //This Event submits the Form

        [WebMethod]

        public static string submitForm(string woTable, string cfTable)
        {
            string craneID = "";
            
            try
            {
                craneID = staticInsertCrane(cfTable);
            }
            catch (Exception f)
            {
                string error = f.ToString();
                return "failed";
            }
            
            try
            {
                staticcreateWorkOrder(woTable, craneID);
                return "success";
            }
            catch (Exception g)
            {
                string error = g.ToString();
                return "failed";
            }
            
            //return true;
        }


Again, the crane is successfully submitted, but it the success event, doesn't fire.


also here's the submit button



<asp:Button runat="server" ID="submitterButton" Text="Add Drawing" OnClientClick="submitForm();" />







Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top