Problem in new way of doing??

S

shahzad

Hi,
As you all know that in classic ASP we when take the user inputs in a form
then when user click submit the form the page moves to the page specified in
action attribute of the form .
Now in Asp.Net how can we do this as the form always posts back to itself .i
want to move it to new page with all the values of the form which the user
fills.How you people manage this problem?
do i have to make a custom url and redirect it to next page but i think it
is not practical way of doing.
thanks in advance.
shahzad.
 
R

Ravikanth[MVP]

Hi

You can use Server.Transfer() method to acheive this
functionality.

The Transfer() method, Terminates execution of the
current page and begins execution of a new page using the
specified URL path to the page. you can specify whether
to clear the QueryString and Form collections.

Example

Server.Transfer("<<URL>>", true)


HTH
Ravikanth
 
K

Kevin Spencer

You can use Server.Transfer to transfer control to the other Page. The
original Page class will still be available to the second, as the
HttpContext.Current.Handler.

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Big things are made up of
lots of Little things.
 
T

Tony Sedgwick

If you do a server.transfer and the new page has an HTML tag you will end up
with invalid HTML which 'could' cause a problem in browsers other than IE.
The alternative of using response.transfer exposes querystring info to the
user which is not desirable as they can easily tamper with it.

Is the best method then to use a session variable? The classic ASP emthod of
posting to another form seems far better.

any thoughts on this welcome.
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top