473,322 Members | 1,480 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,322 software developers and data experts.

passing information between ASPX pages

I would like to pass information between ASPX pages.

For now, my navigation are hardcoded links.
In some case I do a Response.Redirect("pages.aspx")

Now I wonder is this is a good way to do.

For exemple when I log out of my website, i go back to the logon page but I
would like to write on the logon page something like "you succesfully logged
out".
Doing the following does not work :
Response.Write("Sucessfully Logged out!");
Response.Redirect("Logon.aspx");
(I assume a new Response objet is created when i redirect, right?)

Then should I do something like
Response.Redirect("Logon.aspx?message='Sucessfully Logged out!'");

But this may lead in problems and string encoding (as my websites would use
many languages including chinese and japanese)

Then how is the proper, (state of the art :p) way to achieve my goal?

Thanks

Francois
Nov 18 '05 #1
5 1831
Well.... this:
Response.Write("Sucessfully Logged out!");
Response.Redirect("Logon.aspx");
does work...it jsut doesn't have time to send it to the browser.
You can pass the message with a URLEncode() to make sure it's not going to
break the URL

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"francois" <fr******@bettinghouses.com_NOSPAM> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
I would like to pass information between ASPX pages.

For now, my navigation are hardcoded links.
In some case I do a Response.Redirect("pages.aspx")

Now I wonder is this is a good way to do.

For exemple when I log out of my website, i go back to the logon page but I would like to write on the logon page something like "you succesfully logged out".
Doing the following does not work :
Response.Write("Sucessfully Logged out!");
Response.Redirect("Logon.aspx");
(I assume a new Response objet is created when i redirect, right?)

Then should I do something like
Response.Redirect("Logon.aspx?message='Sucessfully Logged out!'");

But this may lead in problems and string encoding (as my websites would use many languages including chinese and japanese)

Then how is the proper, (state of the art :p) way to achieve my goal?

Thanks

Francois

Nov 18 '05 #2
As you put it, i don't know if this is the "state of the
art" way. But if you have reasons not to use
Response.Redirect (a.aspx?message=hello); (QueryString[]
i mean), then why not use Session Variables?

Session Variables will work with any language you may
want.

Let me know if this is what you wanted

Regards,

Michelle

-----Original Message-----
I would like to pass information between ASPX pages.

For now, my navigation are hardcoded links.
In some case I do a Response.Redirect("pages.aspx")

Now I wonder is this is a good way to do.

For exemple when I log out of my website, i go back to the logon page but Iwould like to write on the logon page something like "you succesfully loggedout".
Doing the following does not work :
Response.Write("Sucessfully Logged out!");
Response.Redirect("Logon.aspx");
(I assume a new Response objet is created when i redirect, right?)
Then should I do something like
Response.Redirect("Logon.aspx?message='Sucessfull y Logged out!'");
But this may lead in problems and string encoding (as my websites would usemany languages including chinese and japanese)

Then how is the proper, (state of the art :p) way to achieve my goal?
Thanks

Francois
.

Nov 18 '05 #3
> Well.... this:
Response.Write("Sucessfully Logged out!");
Response.Redirect("Logon.aspx");
does work...it jsut doesn't have time to send it to the browser.
You can pass the message with a URLEncode() to make sure it's not going to
break the URL


avoid having pages of the form:
someURL?message=text

cause other people can exploit it (say from spam e-mails) to show any text
to users as if your site was showing it (they just make the appropriate URL
and send a page/e-mail with such a link to an unsuspected user saying you
sent it). Even MCAfee had such silly URLs some time ago, not sure if they
fixed them, at least I gave them a warning

Use session variables instead - log off the user when the login page is
(re)visited (if you see the user already has some name variable that isn't
equal to null/nothing at the session they were in so log them out and say
goodbye with their name, else don't do anything). To log off just do a
redirection to the login page then which will log the user out and before
logging them out will get their name from the session data and display the
goodbye message etc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
George Birbilis <bi******@kagi.com>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ QuickTime VCL and ActiveX controls (for PowerPoint/VB/Delphi etc.)
+ Plugs VCL and ActiveX controls (InterProcess/Internet communication)
+ TransFormations, VB6 forms to ASP.net WebForms convertion
http://www.kagi.com/birbilis
+ Robotics
http://www.mech.upatras.gr/~robgroup
.................................................. .......................
Nov 18 '05 #4
Not always. Sessions are not always the way either. I would however encode
the URL, or rather encrypt it.... for less threat of a hack attack...

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
"George Birbilis" <bi******@kagi.com> wrote in message
news:O9**************@TK2MSFTNGP09.phx.gbl...
Well.... this:
Response.Write("Sucessfully Logged out!");
Response.Redirect("Logon.aspx");
does work...it jsut doesn't have time to send it to the browser.
You can pass the message with a URLEncode() to make sure it's not going to break the URL
avoid having pages of the form:
someURL?message=text

cause other people can exploit it (say from spam e-mails) to show any text
to users as if your site was showing it (they just make the appropriate

URL and send a page/e-mail with such a link to an unsuspected user saying you
sent it). Even MCAfee had such silly URLs some time ago, not sure if they
fixed them, at least I gave them a warning

Use session variables instead - log off the user when the login page is
(re)visited (if you see the user already has some name variable that isn't
equal to null/nothing at the session they were in so log them out and say
goodbye with their name, else don't do anything). To log off just do a
redirection to the login page then which will log the user out and before
logging them out will get their name from the session data and display the
goodbye message etc.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
George Birbilis <bi******@kagi.com>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ QuickTime VCL and ActiveX controls (for PowerPoint/VB/Delphi etc.)
+ Plugs VCL and ActiveX controls (InterProcess/Internet communication)
+ TransFormations, VB6 forms to ASP.net WebForms convertion
http://www.kagi.com/birbilis
+ Robotics
http://www.mech.upatras.gr/~robgroup
.................................................. ......................

Nov 18 '05 #5
-----Original Message-----
I would like to pass information between ASPX pages.

For now, my navigation are hardcoded links.
In some case I do a Response.Redirect("pages.aspx")

Now I wonder is this is a good way to do.

For exemple when I log out of my website, i go back to the logon page but Iwould like to write on the logon page something like "you succesfully loggedout".
Doing the following does not work :
Response.Write("Sucessfully Logged out!");
Response.Redirect("Logon.aspx");
(I assume a new Response objet is created when i redirect, right?)
Then should I do something like
Response.Redirect("Logon.aspx?message='Sucessfull y Logged out!'");
But this may lead in problems and string encoding (as my websites would usemany languages including chinese and japanese)

Then how is the proper, (state of the art :p) way to achieve my goal?
Thanks

Francois


Hi Francois,

What you could do is to have a variable in the session
which will check if the user is logging out or if the user
is logging in for the first time. While loading the page,
you can check if the session variable exists or not. If it
does exist, then you can display the appropriate logout
message. Else, you don't have to display any message.
Regards,

RAMADU
Nov 18 '05 #6

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

Similar topics

1
by: Matt M | last post by:
Ok. So I'm passing values between web pages, as per microsoft's framework development guide (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/ht...
4
by: Grant | last post by:
Im using C# in a web app. Ive got a page with a linkbutton with the following code for the click event: ----------------- Session = "Test"; Server.Transfer("TestPage.aspx"); -----------------...
4
by: Gibs | last post by:
Hi I have two aspx pages in a frame and in the top page i am creating the controls dynamically and putting in a place holder. I have a hyperlink in this page to populate the data in the bottom...
3
by: Evan | last post by:
I have a web page with 2 frames. The left frame is running menu.aspx and the right frame is running images.aspx. When a selection is made in menu.aspx I call a method in images.aspx and pass a...
1
by: John | last post by:
Hi I have on my page1.aspx the following; Context.Items("Msg1") = msgstr Response.Redirect("Page2.aspx") Page2.aspx has the following; Protected Sub Page_Load(ByVal sender As Object,...
7
by: Smokey Grindle | last post by:
For a website that has users logged into it using sessions, its it best to pass data between pages in session variables or through query strings?
1
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...
3
by: Nathan Sokalski | last post by:
I am recieving the following error on the second postback of a page I have written: The state information is invalid for this page and might be corrupted Stack Trace: ...
3
by: dbuchanan | last post by:
newbie question What are the various ways that data can be passed between pages. For example; How is data about the logged in user passed to subsequent pages Thank you, Doug
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.