newbie navigation/form re-draw issue...

R

roger beniot

I'm trying to figure out how to do something in ASP.NET that used to
be accomplished by doing a post from one page to another page.

If a webform as fields for user information (address, name, phone,
etc) and a submit button... What is the best way in asp.net to
re-display the information and ask the user to verify the info is
correct.

Will I do a post back to the same webform, remove the previous web
server controls and redraw the page w/ the new information?

Would it be best to transfer to a new page (via Response.Redirect
(url) or Server.Transfer (url)) and get the information from the first
webform?


thanks,
roger
 
C

Chris Moore

It's probably easiest to do something like posting the data to a new form
which will display it to the user and ask for confirmation. You could also
write your original page to check for whether this is a postback or not,
and then generate the form's target and the data fields on the fly.
Assuming your page is "page1.aspx" it might be something like:

<some header information>
...
if (isPostBack = true) then
Response.Write("Please confirm the data and hit sumbit again (or some
other message)");
endif

if (isPostBack = true) then
response.write("<form method=post target=page2.aspx");
else
response.write("<form method=post target=page1.aspx");
endif

Then, when writing out your textboxes and other input forms, you can check
to see if ispostback = true and it it is, you can populate the value
appropriately from the request object.

</form>

Just a thought,
Chris


--------------------
 

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

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top