473,387 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Response.Redirect question

Hi,

In the Form1.aspx, I have
Response.Redirect("Form2.aspx?lblUserName=" + "John");
However, in the browser, when I go to the Form2 via Form1's
Response.Redirect, I don't find the John in the label lblUserName.
Would someone tell me what have I done wrong with it?
Thanks for help.
Jason
Jun 8 '07 #1
3 1053
Hello, Jason!

Response.Redirect("Form2.aspx?lblUserName=" + "John");

means that Form2.aspx request's querÕ parameter will contain value "Jonh"
under key "lblUserName"

In the other words Form2.aspx this.Request["lblUserName"] will be equal to
"Jonh"

You wrote on Fri, 8 Jun 2007 14:59:27 +0800:

JHHi,

JHIn the Form1.aspx, I have
JHResponse.Redirect("Form2.aspx?lblUserName=" + "John");
JHHowever, in the browser, when I go to the Form2 via Form1's
JHResponse.Redirect, I don't find the John in the label lblUserName.
JHWould someone tell me what have I done wrong with it?
JHThanks for help.
JHJason

With best regards, Vadym Stetsyak.
Blog: http://vadmyst.blogspot.com
Jun 8 '07 #2
Jason Huang wrote:
Hi,

In the Form1.aspx, I have
Response.Redirect("Form2.aspx?lblUserName=" + "John");
However, in the browser, when I go to the Form2 via Form1's
Response.Redirect, I don't find the John in the label lblUserName.
Would someone tell me what have I done wrong with it?
Thanks for help.
What you have done wrong is to expect some functionality that simply
does not exist.

There is no connection between the querystring and the controls on the
page. That would be a security risk, as anyone would be able to change
the content of any control on the page, even a password field.

You use the Request.QueryString collection to get the values from the
querystring. Request.QueryString["lblUserName"] will contain the value.

--
Göran Andersson
_____
http://www.guffa.com
Jun 8 '07 #3

"Jason Huang" <Ja************@hotmail.comwrote in message
news:Ok**************@TK2MSFTNGP05.phx.gbl...
Hi,

In the Form1.aspx, I have
Response.Redirect("Form2.aspx?lblUserName=" + "John");
However, in the browser, when I go to the Form2 via Form1's
Response.Redirect, I don't find the John in the label lblUserName.
Would someone tell me what have I done wrong with it?
Thanks for help.
All you did was pass a parameter value back to Form2 with the of
lblUserName. the parm could have been called John.

In order to get the parm lblUserName or John value of *John* you have to use
the QueryString statement in Form2 to set lblUserName.Text =
Request.QueryString["lblUserName"]

You may want to look-up Request.Form too.

Jun 8 '07 #4

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

Similar topics

4
by: JC | last post by:
Hi, I have a simple question regarding the Response.Redirect method. Does the server stop processing the ASP code as soon as it encounters the Redirect command? Or does it ever continue to...
8
by: Daniel | last post by:
Hello, I have an old asp page that was used to redirect users called redirect.asp: <code1> <% Option Explicit If Request.QueryString("url") <> "" Then Response.Redirect ...
3
by: Sehboo | last post by:
On my ASP page, when I click a button, I want to do three things: 1. Check for some values. 2. Open a new window and pass some values as query string. 3. Redirect to some other page Here...
3
by: Jed | last post by:
I have written an HttpHandler which I invoke through an ashx page. The HttpHandler does various things to process the request, then it is supposed to redirect to a confirmation page. Everything...
6
by: Keith Patrick | last post by:
I have to do some programmatic redirects (in several pages) based on URLs I am given from an external source. The URLs have querystrings at the end, but one in particular is about 240 chars long,...
2
by: news://news.microsoft.com/microsoft.public.de.germ | last post by:
Hallo! Ich habe ein Frameset mit 3 Frames. Im 1. Frame wird eine ASPX-Seite geöffnet. In dieser werden einige Steuerelemente angezeigt. Nun soll bei bestimmten Benutzeraktivitäten eine andere...
3
by: Alan Silver | last post by:
Hello, Sorry if this is a stupid question, but I can't really see much difference between these tow methods according to the scant info in the SDK. Could anyone enlighten me? TIA -- Alan...
1
by: Kevin Blount | last post by:
Background: My script is designed to only allow the downloading of a file if a cookie exists to say that someone is logged into my companies site. A colleague set up a test area the extension...
1
by: Eric | last post by:
I have the following situation: I was getting intermittent errors using Reponse.Redirct("url", true) and was trying to catch the ThreadAbortException, but it was not staying caught and was showing...
9
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.