When button1 is clicked, a server-sided code Button1_Click is executed to submit data into a database. On the other hand, SubmitForm() is client-sided code. How do I make both work when pushing the button named button1 (my submit button)? The code provided below only triggers the Onclick event when the button is pushed and ignores the OnClientClick function.
<asp:Button ID="Button1" runat="server" Onclick = "Button1_Click"
OnClientClick = "javascript:SubmitForm();return false"
Text="Submit" Width="98px"
/>
This snippet shows the validation logic in my submit form code:
function SubmitForm() {
// Validation checks go here
// Creation of COO_BTO_Test.bat file
}
And this is the code for button1_click:
protected void Button1_Click(object sender, EventArgs e)
{
// Database insertion process here
}