473,491 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Putting Current URL in a Session Variable

Is there any way of setting the URL of the current page in a session
variable?

I want to do this so I can create links and redirects back to the page on
which the user invokes a particular procedure.
Jul 19 '05 #1
4 1869
If it makes a difference, the site is in frames. The URL I want to capture
is that of the page loaded in the Main frame.

"Keith" <@.> wrote in message news:Os**************@tk2msftngp13.phx.gbl...
Is there any way of setting the URL of the current page in a session
variable?

I want to do this so I can create links and redirects back to the page on
which the user invokes a particular procedure.

Jul 19 '05 #2
Keith wrote on 26 aug 2004 in microsoft.public.inetserver.asp.general:
"Keith" wrote in message
Is there any way of setting the URL of the current page in a session
variable?

I want to do this so I can create links and redirects back to the
page on which the user invokes a particular procedure.

If it makes a difference, the site is in frames. The URL I want to
capture is that of the page loaded in the Main frame.


[Please do not toppost, even answering your own posts]

<%
mySite = "http://www.mySite.com"
session("myUrl") = mySite & "/myfolder/mypage.asp"
%>

or more general [but why would you?]

<%
mySite = "http://www.mySite.com"
session("myUrl") = mySite & Request.servervariables("URL")
%>

ASP does not know about frames !

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 19 '05 #3

"Evertjan." <ex**************@interxnl.net> wrote in message
news:Xn********************@194.109.133.29...
Keith wrote on 26 aug 2004 in microsoft.public.inetserver.asp.general:
"Keith" wrote in message
Is there any way of setting the URL of the current page in a session
variable?

I want to do this so I can create links and redirects back to the
page on which the user invokes a particular procedure.

If it makes a difference, the site is in frames. The URL I want to
capture is that of the page loaded in the Main frame.


[Please do not toppost, even answering your own posts]

<%
mySite = "http://www.mySite.com"
session("myUrl") = mySite & "/myfolder/mypage.asp"
%>

or more general [but why would you?]

<%
mySite = "http://www.mySite.com"
session("myUrl") = mySite & Request.servervariables("URL")
%>

ASP does not know about frames !

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)


The second method is great (using request.servervariables("url").

However, is there a way of also capturing any parameters that were passed to
the page when it was opened?
Jul 19 '05 #4
Keith wrote on 26 aug 2004 in microsoft.public.inetserver.asp.general:
The second method is great (using request.servervariables("url").

However, is there a way of also capturing any parameters that were
passed to the page when it was opened?


Sure.

wholeQuerystring = request.querystring

You can read the request.form collection with a for..each loop.

=======

btw:
I think you will have to study ASP tutorials and [sample] page files.
They are all over the web.
To ask every single method of ASP programming will not get you far.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 19 '05 #5

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

Similar topics

4
2002
by: Igor | last post by:
Is it possible to point current context's session to another active session based on a SessionID?
2
3313
by: moondaddy | last post by:
I need to set a variable to a session variable (if that's what you call it) like this: dim ds as dataset = HttpContext.Current.Session("CustDataSet") But I get an exception if this variable...
0
2173
by: Rodusa | last post by:
I am trying to replace cookies with the new "Asp.net 2.0 profiles" in my shopping cart application, but I am having trouble to access profile properties using HttpContext.Current.Profile. I can...
2
1717
by: ABC | last post by:
How to I know the previous page is clicked to forward the current page? As our web site have many methods to enter the web page, I need to know the users clicked which link or which part of...
9
3897
by: Edge | last post by:
hi, I am saving the user selected culture in a session variable so I can apply it back to all pages when refreshed and then load the proper .resx values. For that I am using global.asax
4
1515
by: Jon Paal | last post by:
I captured an arraylist into a session value but to display the current values, the page requires a postback or else it displays the prior version of the value. how do I force a post back...
1
1336
by: nem.usenet | last post by:
Hi everyone, I searched for this but with little luck. I'm working on a project and need to do the following: 1. have a user authenticate to an ASP.net site using windows authentication 2....
2
11927
by: Dave | last post by:
After some digging, I discovered HttpContext.Current.Session is null when trying to access a session variable, username, in my upload.cs code which is in the App_Code folder. I just determined...
14
29416
by: R.A.M. | last post by:
Hello, I have created ASP.NET project in which I have a file Admin.cs. It contains static class Admin with some methods and properties. The problem is that in property get a reference...
0
7115
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,...
0
7154
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,...
0
7190
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...
0
5451
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,...
0
3086
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...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1392
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 ...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
280
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...

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.