Problem in new way of doing??

  • Thread starter Thread starter shahzad
  • Start date Start date
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.
 
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
 
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.
 
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.
 
Back
Top