Hi
every one.
I have a usercontrol and i populate it in modalpoup. which contains Save button and this button validates the all controls .if i click on save button it should save the record in the DB.But i have a problem here , i am able to click the save button more than once this time duplicate records are inserted. can any one help me how to prevent the double clicking of the Button.
Help me plz
Loading


Suthish NairRank #92 · 22.8K reputationPosted Mar 20, 2012, 5:24 AM EDT
Disable a submit button during Post Backs
Naresh Babu GopavaramRank #9,687 · 203 reputationPosted Mar 20, 2012, 5:28 AM EDT
SenthilkumarRank #387 · 6.5K reputationPosted Mar 20, 2012, 5:41 AM EDT
When click on button, you have to disable the control.
in JavaScript, you have to write the following:
function SubmitResult()
{
document.getElementById('btnSubmit ').disabled = true;
__doPostBack('btnSubmit','click');
}
It will identify the click event of the server side.
protected void btnSubmit_Click(object sender, eventargs e)
{
}
Naresh Babu GopavaramRank #9,687 · 203 reputationPosted Mar 20, 2012, 5:55 AM EDT