I am using asp.net webforms; I want to submit a form and keep the button disabled until it gets saved to my database, exactly like Stackoverflow. Any suggestion?
protected void Lb_Save_Click(object sender, EventArgs e)
{
//disable my button
//Do a DB insert
//enable my button
}
EDIT:
I'll do a client-side validation first so I don't want my button to be disabled there but I want to disable it once the onclick function starts. Hope you all get my point.
Also i would like to do the same for asp:linkbutton but i don't know how firefox behaves for it. As the linkbutton will be rendered as anchor how can i disable it?
Guys you didn't get my question.
How to disable asp:button during postback? (not in jQuery/Javascript)