SmashAndGrab
asked on
ASP Button question
Hi,
I have this button.
<asp:Button ID="btnUpdate" OnClientClick="return Validate(this, this.id);" class="btn btn-primary" runat="server" Text="Update" AutoPostBack="true" />
When the user clicks it - it runs a simple javascript.
My question is: How do I get the button run my specific C# function after it has validated?
I have this button.
<asp:Button ID="btnUpdate" OnClientClick="return Validate(this, this.id);" class="btn btn-primary" runat="server" Text="Update" AutoPostBack="true" />
When the user clicks it - it runs a simple javascript.
function Validate(obj, objid) {
// does some valiudation here then submits
__doPostBack(objid, '');
}
My question is: How do I get the button run my specific C# function after it has validated?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If OnClickClient doesn't return anything the codebehind event will fire regardless. So you want..
Open in new window
Open in new window
Above code reference is from below link
http://stackoverflow.com/questions/28760687/invoke-onclientclick-of-button-in-code-behind