Click here to Skip to main content
11,576,667 members (59,595 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
I want send value one to another page by server.transfer
How can I use this...?
Posted 2-May-12 20:33pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 5

you can use session for alternative

Session["a"]=txtUsername.Text;
Server.Transfer("Serverside.aspx")


in Serverside.aspx page

u can get this session by

Label1.Text=Session["a"],ToString();
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

Hi,

Server Side Transfer
In this method, the server will initiate the navigation like Client side browser redirect, but here the server code will simply hand over the control to some other web page so that the new page will then be rendered.
Server.Transfer("path"); 
Example
Server.Transfer("Serverside.aspx")

Here URL is not changed. That's because the browser had no idea that server has pushed another page for its request. Browser still thinks that it is displaying the old URL's page.
  Permalink  
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

This will show you how ans when should you use this:

Understanding Page Navigation Techniques in ASP.NET[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

Actually Server.Transfer Method is not useful in many case since it will throw an error ASP0173 if we're using any sort of the Special Symbol in the Server.Transfer("pageUrl?querystring") it will throw an error asp0173 since it will not accept any sort of the Special chacters , The only one advantage of using Server.Transfer is it only forward 1 request to the server while response.redirect forwards two requests to the server.
Server.Transfer is added as an alternative to the Response.Redirect but it's limitation and drawaback never makes it popular,
If you wanted to have more secure redirection you can use Response.Write(Server.URLEncode("pageurl")); but still it has limitation if you're not using it properly , the other alternative is to use the UrlRedirect : "I am Recommanding you to use it"
Till date it is the only highly Secure Method of the Page redirect is available. you can read it at
http://www.c-sharpcorner.com/UploadFile/rohatash/url-routing-in-Asp-Net-4-0/

Thanks and Regard,
Abhinav Kumar Singh(abhinavsingh993),
Software Tester,
Goodmaysys Software Pvt. Ltd.
Lucknow.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 7

Hello Sir, Actually 'Server.Transfer' Method is not useful in many case since it will throw an error ASP0173 if we're using any sort of the Special Symbol in the Server.Transfer("pageUrl?querystring") it will throw an error asp0173 since it will not accept any sort of the Special chacters , The only one advantage of using Server.Transfer is it only forward 1 request to the server while response.redirect forwards two requests to the server.
Server.Transfer is added as an alternative to the Response.Redirect but it's limitation and drawaback never makes it popular,
If you wanted to have more secure redirection you can use Response.Write(Server.URLEncode("pageurl")); but still it has limitation if you're not using it properly , the other alternative is to use the UrlRedirect : "I am Recommanding you to use it"
Till date it is the only highly Secure Method of the Page redirect is available. you can read it at
http://www.c-sharpcorner.com/UploadFile/rohatash/url-routing-in-Asp-Net-4-0/

Thanks and Regard,
Abhinav Kumar Singh(abhinavsingh993),
Software Tester,
Goodmaysys Software Pvt. Ltd.
Lucknow.
  Permalink  
Comments
CHill60 at 22-Jul-13 17:52pm
   
Why post the same answer twice to a question that is a year old?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 251
1 Abhinav S 135
2 Lucifier Rocks 105
3 Dave Kreskowiak 80
4 F-ES Sitecore 80
0 OriginalGriff 705
1 Sergey Alexandrovich Kryukov 626
2 Abhinav S 483
3 F-ES Sitecore 410
4 Suvendu Shekhar Giri 365


Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 31 Jul 2014
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100