I've had this post in the c# section for a week and a half now, realized it should be here, and I don't know how to move a message, so please forgive the double post, and if there's a way to move messages, let me know and I'll do so.
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?
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?