473,725 Members | 2,070 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Passing Values and Server.Transfer

Hello all.

With a background in ASP, I am finding the work required for passing
values between pages mystifying. For various obvious reasons, I have
eliminated using cookies and session to store state data. The only
ASP.NET options left is to use the Server.Transfer to transfer to page
2 from page 1, and then use the context to get whatever values in page
1 from page 2. I do find this indeed a very elegant solution as now I
can pass objects instead of plain text values.

But the problem is with the out of sync URL when using
Server.Transfer . I am scratching my head as to how anybody can not see
this as a problem. Not only the URL being display is not the same as
the page that you are seeing, it is also consistently one step behind
in a wizard-like sequential pages environment. Is it not confusing as
hell for the users?

Is there a better way to handle such a basic infrastructure problem
(passing values between pages), or am I just stuck in the old ASP
thinking?

Thanks in advance.

Nov 19 '05 #1
1 2710
> But the problem is with the out of sync URL when using
Server.Transfer . I am scratching my head as to how anybody can not see
this as a problem. Not only the URL being display is not the same as
the page that you are seeing, it is also consistently one step behind
in a wizard-like sequential pages environment. Is it not confusing as
hell for the users?


Yeah, but the url showing is the url that the browser posted to. Server.Transfer
is all done server side and thus the browser really doesn't know that the
second page is the one that did the rendering. In ASP.NET 2.0 they've introduced
cross page postbacks which is the prefered way to accomplish what you're
doing. I posted about this, FWIW:

http://staff.develop.com/ballen/blog...c-d3b8b4f29eaf

-Brock
DevelopMentor
http://staff.develop.com/ballen


Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
3715
by: Jim Mitchell | last post by:
I have one ASPX page that calls another using server transfer as shown below. The problem is that I do not get the cookie in the second page. The value seems to be blank. Any help would be appreciated. Thanks, Jim
2
1729
by: Dr. Know | last post by:
When using the Response.Redirect in test1.asp in this manner: Response.Redirect ("test2.asp?err=something&msg=somethingelse") You can pass values calculated in test1.asp to test2.asp. But this is a round trip redirect - and also shows passed values in the address bar. But when using Server.Transfer, as in:
1
1265
by: Troy | last post by:
Hello, I'd like to pass data between two pages but unable to get code to work. Code is below and any help is appreciated: ********************************************************************** 'Page1.aspx <%@ import namespace="System.Data" %> <%@ import namespace="System.Data.sqlclient" %>
1
6901
by: Eric | last post by:
Hello, I am trying to come up with the best way to pass large amounts of data from page to page, namely a data table. The user needs to enter data into a form in one page and confirm it on another. Session variables seem like the easiest, but I'm afraid of crashing the server after deploying with a few hundred users as opposed to just a few developers/testers. Any ideas?
4
1600
by: gkr | last post by:
Hi I would like to pass values/data from Page1 to Page 2, then capture values on page 2 and return back to Page 1 with the values from page2. Can you pls guide me on how to do this ? I tried Server.transfer to pass values from Page1 to Page2, but from page2 am unable to return to Page 1 or any other page with the values picked from Page2.
8
1962
by: Chris | last post by:
Hi, I have two froms (form1 and form2). I want to be able to pass values from form 1 to form2 and be able to use those values leter in form2. This is my code for form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Server.Transfer("form2.aspx", True) End Sub
1
2342
by: Steve | last post by:
After a few hours of trial and error I have reached the following conclusions, can you please tell me if I am right: I have 2 aspx pages both with the same master page and I wish to pass values from one to the other. 1. The postbackurl method doesn't seem to work with master pages. If I take away the master pages it works. 2. The server.transfer method also doesn't work if I try to acess the
1
2114
by: vncntj | last post by:
I have a C#.NET that simply passes 6 values to a Stored Procedure. But I'm trying to get the (Default.aspx.cs page) to handle passing the values to the sp. The goal is to pass the values and see if any records are returned. I will later insert some conditional statements. Here is my Default.aspx.cs protected void btnNext_Click(object sender, EventArgs e) {
1
1984
by: axapta | last post by:
Hi Group, I'm not sure if there's a limit to the amount of parameters you can pass between pages. I'm trying to pass 9 as follows: strRedirect = "PlacementHistory.aspx" & _ "?hlscaseno=" & Me.txtHLSCaseNo.Text.ToString & _ "&SeqNo=" & Me.txtseqno.Text.ToString & _ "&type=" & Me.txtType.Text.ToString & _ "&regno=" & Me.txtRegNo.Text.ToString & _
0
8888
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9401
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9257
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9176
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6011
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4784
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3221
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2635
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.