ASP.NET 2.0 Form

D

dm1608

I have a form that once users select various options, it will postback to
itself and display a datagrid.

The form is in one panel and the datagrid is in another panel.

Within the formload event, I'm enabling or disabling the panel.

One of the challenges that I'm having is that I would like to have a "Reset"
button on my form to clear out the fields back to the default values. I'm
not exactly sure the best way to do this based on my design. I thought this
would be an easy thing to do, but when I hit Reset, the form posts back to
itself and then the datagrid tries to show.

Is there a way I can clear the form without doing a postback or at least
check to see what button was pressed within my formload...

I'm currently checking whether the form is in postback mode or whatever and
setting enabling the two panels appropriately.

Thanks for any help.
 
J

Jesse Liberty

Create an event handler for the Reset button and in that (a) do your reset
and (b) set a flag (bWasReset = true).

I'm not sure what triggers a post back besides that, but you can give those
events a common handler to show or not show the grid (and skip the flag) or
you can decide in PreRender (rather than load) by checking that flag (and
the IsPostBack flag) to decide whether or not to show your panel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,280
Latest member
BGBBrock56

Latest Threads

Top