473,785 Members | 2,289 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Redire ct("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( "Sucessfull y Logged out!");
Response.Redire ct("Logon.aspx" );
(I assume a new Response objet is created when i redirect, right?)

Then should I do something like
Response.Redire ct("Logon.aspx? message='Sucess fully 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 1847
Well.... this:
Response.Write( "Sucessfull y Logged out!");
Response.Redire ct("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******@betti nghouses.com_NO SPAM> wrote in message
news:%2******** ********@TK2MSF TNGP11.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.Redire ct("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( "Sucessfull y Logged out!");
Response.Redire ct("Logon.aspx" );
(I assume a new Response objet is created when i redirect, right?)

Then should I do something like
Response.Redire ct("Logon.aspx? message='Sucess fully 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.Redire ct (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.Redire ct("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 ("Sucessfull y Logged out!");
Response.Redir ect("Logon.aspx ");
(I assume a new Response objet is created when i redirect, right?)
Then should I do something like
Response.Redir ect("Logon.aspx ?message='Suces sfully 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( "Sucessfull y Logged out!");
Response.Redire ct("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******** ******@TK2MSFTN GP09.phx.gbl...
Well.... this:
Response.Write( "Sucessfull y Logged out!");
Response.Redire ct("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.Redire ct("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 ("Sucessfull y Logged out!");
Response.Redir ect("Logon.aspx ");
(I assume a new Response objet is created when i redirect, right?)
Then should I do something like
Response.Redir ect("Logon.aspx ?message='Suces sfully 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
3037
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 ml/cpconPassingServerControlValuesBetweenPages.asp) So, I have two pages, one that has some public properties and fires a Server.Transfer("receivepage.aspx"); The receivepage.aspx can then get some of the public properties I've set on the first page.
4
1404
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"); ----------------- In the testpage Page_Load section I have the following: ------------------
4
2356
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 aspx page. When the user clicks this hyperlink i need to populate the bottom aspx pagebased on the user imputs. So i need to pass the values from the top aspx page to bottom aspx page. how can i achieve this. Please give some ideas...
3
2725
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 variable. The intention is that images.aspx will take the variable and load images into its frame (the right one) based on the variable passed. What actually happens is the method runs in the left frame and ruturns the error "Object reference not...
1
1045
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, ByVal e As System.EventArgs)
7
1880
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
2344
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
3
8707
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: System.Convert.FromBase64String(String s) +0
3
2282
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
9647
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
10357
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
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4063
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
3
2893
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.