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)
and here is the cs code:
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?
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?