I'm creating a User Control for a quick form. This need needs to store data in two places: one is a custom built (by someone else) database that uses JavaScript to submit the data, and the other is a CRM that uses .NET APIs to submit data.
My form currently submit the JavaScript side without problem, but I cannot get any .NET code to run.
An example of my code is:
nps.ascx
<html>
<head>
<script type='text/javascript'>
function doSubmit() {
SubmitJavaScriptBasedData('title','stuff',$['[id$=comment]').val());
$('[id$=comment].css('visibility','hidden');
return true;
}
</script>
</head>
<body>
<asp:RadioButton ID="RB1" GroupName="Buttons" runat="server" /><br />
<asp:RadioButton ID="RB2" GroupName="Buttons" runat="server" /><br />
<asp:RadioButton ID="RB3" GroupName="Buttons" runat="server" /><br />
<asp:RadioButton ID="RB4" GroupName="Buttons" runat="server" /><br />
<p>
<asp:TextBox id="comment" runat="server" TextMode="MultiLine"></asp:TextBox>
<p>
<asp:Button id="submitBtn" runat="server" Text="Go!" OnClientClick="doSubmit();" OnClick="submitComment_Click"></asp:Button>
<p>
<asp:Label id="lblTest" runat="server"></asp:Label>
</body>
</html>
nps.ascx.cs:
...
protected void submitComment_Click(object sender, EventArgs e)
{
lblTest.Text = "Hello World!";
}
...
When I click my button, I get the expected JavaScript things happening: my remote database is updated and the 'comment' textbox disappears. However, no .NET code is executed at all.
Can anyone help me understand why I'm not getting .NET stuff executed?
P.S. I re-wrote this code from memory and as an example - including all the (I think) relevant pieces) - so there may be mistakes during typing. I think the underlying issue, however, is specifically to do with submissions.