srithil Posted May 1, 2004 Posted May 1, 2004 How do I refresh the form after i click the submit button on the form. I am a new user to asp.net. tx. Quote
Moderators Robby Posted May 1, 2004 Moderators Posted May 1, 2004 I'm not sure that I understand. Clicking a button that posts back to the server is in a sense refreshing the page. Quote Visit...Bassic Software
srithil Posted May 1, 2004 Author Posted May 1, 2004 how do i refresh the fields. How do i clear all the fields values after submitting to the server.my fields are not clearing. Quote
wessamzeidan Posted May 1, 2004 Posted May 1, 2004 for textboxes you could do this textbox1.Text="" Quote Proudly a Palestinian Microsoft ASP.NET MVP My Blog: wessamzeidan.net
srithil Posted May 1, 2004 Author Posted May 1, 2004 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(). Quote
wessamzeidan Posted May 1, 2004 Posted May 1, 2004 No, I don't think so Quote Proudly a Palestinian Microsoft ASP.NET MVP My Blog: wessamzeidan.net
tate Posted May 1, 2004 Posted May 1, 2004 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 Quote
Moderators Robby Posted May 1, 2004 Moderators Posted May 1, 2004 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. Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.