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

Read current url

Is there a way that I can read the current url.

I have an asp page currently such as default.asp?x=1&y=2&z=3

Now I want to keep the existing parameters and attach another parameter
to it and resend to default.asp

As the original parameters are dynamic, and may or may not be
generated, the only way is to read the current url and to simply add my
new parameter such as h=5 to the url.

I don't know how to read the current url.

I tried Request.ServerVariables("SCRIPT_NAME") but that didn't include
the parameters. i.e. it just returned the default.asp

Thank you for your help.

Aug 17 '05 #1
4 1773
CurrentPage = Request.ServerVariables("SCRIPT_NAME")

And to see all the server variables for a Web page try this:
Response.Write "<br>Server:<br>"
For Each varItem in Request.ServerVariables
For I = 1 to Request.ServerVariables(varItem).Count
Response.Write varItem & " = " & Request.ServerVariables(varItem)(I) &
"<br>"
Next ' Next I.
Next ' Next varItem.

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...

<<
I don't know how to read the current url.

*** Sent via Developersdex http://www.developersdex.com ***
Aug 17 '05 #2
IranMania wrote:
Is there a way that I can read the current url.

I have an asp page currently such as default.asp?x=1&y=2&z=3

Now I want to keep the existing parameters and attach another parameter
to it and resend to default.asp

As the original parameters are dynamic, and may or may not be
generated, the only way is to read the current url and to simply add my
new parameter such as h=5 to the url.

I don't know how to read the current url.

I tried Request.ServerVariables("SCRIPT_NAME") but that didn't include
the parameters. i.e. it just returned the default.asp

Thank you for your help.


Look up the Request.ServerVariables() collection.. lots in there worth
knowing, including the "URL" value

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com
Aug 17 '05 #3
Thank you everyone for the posts. I was thinking I could also use
Request.QueryString and simply append that to
Request.ServerVariables("SCRIP*T_NAME") or
Request.ServerVariables("URL")

Thank you

Aug 17 '05 #4
Perhaps something like this:

<%= Request.ServerVariables("SCRIPT_NAME") %>?<%=
Request.ServerVariables("QUERY_STRING") %>

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...

<<
Thank you everyone for the posts. I was thinking I could also use
Request.QueryString and simply append that to
Request.ServerVariables("SCRIP*T_NAME") or
Request.ServerVariables("URL")

*** Sent via Developersdex http://www.developersdex.com ***
Aug 18 '05 #5

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

Similar topics

0
by: Garrett Kajmowicz | last post by:
I have two implementations of stringstream and they both handle interleaved reads and writes differently. I was hoping that you might be able to shed some light as to the "correct" operation, and...
2
by: Sandman | last post by:
Just looking for suggestion on how to do this in my Web application. The goal is to keep track of what a user has and hasn't read and present him or her with new material I am currently doing...
3
by: Vic | last post by:
Dear All, I have a database of laboratory records in Access 2000. There is one form which acts as an interface to input experimetal data. This form incorporates information from several tables....
2
by: Blankdraw | last post by:
.... somewhere, a newbie is dying ... Is there anybody out there who can help me get the right input for the following segment? I am trying to read entire records of 5 (2-digit) integers at a...
3
by: gn | last post by:
Due to the production servers being a multiple server farm and not being able to write xml files to them, I am having to change my application to write to HttpContext.Current.Application("var") I...
1
by: Jose Reckoner | last post by:
I'm running python 2.3 on Windows XP. Anyone have a quick small script to convert .DT1 and .DEM data to ASCII or some other format? I don't need a viewer. Thanks!
1
by: youqing | last post by:
Hello, all: I have a problem like this: I created a database in txt.like this: "143483",1234 "143484",1235 "143485",5588 "143486",5876 "143488",8568 "143487",8756 .......
5
by: troy | last post by:
Could someone please point me in the right direction on how to read in a large query with .net. I am trying to emulate a legacy database system so I don't know the upper bounds of the sql query....
21
by: Peter Larsen [] | last post by:
Hi, I have a problem using System.Runtime.InteropServices.ComTypes.IStream. Sample using the Read() method: if (IStreamObject != null) { IntPtr readBytes = IntPtr.Zero;...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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,...

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.