PDA

View Full Version : Reset Button


HDZ
08-06-2008, 09:41 AM
I've coded a reset button in asp.net using C#, it's working perfectly, the only wrong thing is that i couldn't disable the submit behaviour on the button so after the button is clicked it resets all fields but giving the impression of submit in the status bar. Knowing that UseSubmitBehaviour is set to false.
This is my code:

protected void btnReset_Click(object sender, EventArgs e)
{ // Reset button to clear all controllers (text boxes )


txtFirstName.Text = String.Empty;
txtMiddleName.Text = String.Empty;
txtLastName.Text = String.Empty;
}
I appreciate any prompt help,
HDZ

Brandoe85
08-06-2008, 09:36 PM
I think you misunderstood what UseSubmitBehavior does. It still will be posted back to the server. You should be looking at a javascript solution otherwise.

Ref:
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.usesubmitbehavior.aspx

Good luck;

HDZ
08-07-2008, 11:51 PM
Thanks alot for replying.. Any suggested links to help me figuring out the solution?

HDZ