Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing the current URL

Status
Not open for further replies.

mattbold

Programmer
Oct 5, 2001
45
0
0
GB
hello

I've just been pondering this and wondered if any of you could aid me :)

I'm adding a simple dynamic online help bit to my site, it is one page (help.aspx) and shows help text appropriate to the page that linked to it. This works fine, but now i'd like to add a link that goes back to the previous page, and i'm pondering how to achieve this. i could pass the URL of the page to the help page in the querystring and use that in making the link, but that seems a little silly... i'm sure there's a much better way, can anyone help?

cheers ,
matt
 
<a href=&quot;javascript:history.go(-1);&quot;>Go Back</a>

-paul

penny.gif
penny.gif

The answer to getting answered -- faq855-2992
 
Or if you want to do this in the code look at using
Request.URLRefferer

That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
hello,

Yes i would prefer to do it in the code, i've been trying all sorts of options on the request.URLReferrer, but i keep getting &quot;Object reference not set to an instance of an object.&quot; i've tried things like:

hyperlink1.NavigateUrl = Request.UrlReferrer.LocalPath
and
hyperlink1.NavigateUrl = Request.UrlReferrer.AbsolutePath

i've also tried setting the text of a label using request.urlreferrer but i still get the same error..

any chance of a few more pointers?

- matt
 
Sorted it

was my firewall, soon as i switched it off it worked fine :)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top