How do I redirect?

joe_pool_is

Contributor
Joined
Jan 18, 2004
Messages
507
Location
Longview, TX [USA]
In my webform's VB code, after a user clicks btnSubmit on my form named Quote.aspx, I gather the info on the form and email it to myself.

I would like to be able to redirect my user to a new page - say SubmitOK.aspx, located in the same directory. How would I tell Quote.aspx to load SubmitOK.aspx from the webform VB code in Quote.aspx?
 
Joe, if you are redirecting to a page on the same server and you would like to mantain viewstate use Server.Transfer("SubmitOk.aspx")
 
Thanks, Robbie! That worked great!

If you have a minute, I have another question. Heres some background info:

These forms of mine each have about 50 different fields; most are TextBoxes, but some are ComboBoxes and there are a few True/False RadioBoxes. It is taking a very long time to go through each of these objects to assign them an associated name (i.e. Name field gets named txtName).

Not only that, but my btnSubmit and btnReset also require a tremendous amount of "busy work" coding, too. For my btnReset_Click event, every object on my form has to be manually set (each TextBox.Text = "", each ComboBox.SelectedIndex = -1, and each radDefault.Checked = True). For my btnSubmit_Click event, every object on my form similarly is collected into a strString (strString = TextBox.Text, strString &= ComboBox.SelectedItem.Text, or a True/False If...Then statement for the RadioButtons).

Obviously, there must be a more intelligent method of doing this. Would you (or anyone else) happen to know of a technique/trick that would simplify this monster?

Thanks for the help!
~Joe
 
Back
Top