How do I refresh a page on submit

srithil

Newcomer
Joined
Apr 30, 2004
Messages
21
How do I refresh the form after i click the submit button on the form.
I am a new user to asp.net.

tx.
 
I'm not sure that I understand.
Clicking a button that posts back to the server is in a sense refreshing the page.
 
how do i refresh the fields.

How do i clear all the fields values after submitting to the server.my fields are not clearing.
 
Is there any other methods to clear the fields since i have many textboxes in my form.
Is there any method as form.submit() in asp.net or form.clear().
 
How about something like this;

Dim ctrl As Control
For Each ctrl In ctrlParent.Controls
If TypeOf ctrl Is TextBox Then
ctrl.Text = ""
End If
Next
 
You can place a Reset button on the form BUT the problem with that is if you change a textbox's value during postback the reset will consider that new value as the default value. ie...

First time you load a page....
text1.Text = ""

On postback you cahnge the value because of some condition on the server...
text1.Text = "Hello"

Clicking the Reset button now will set text1's value to "Hello"

Long story short, use tate's method above.
 
Back
Top