473,385 Members | 1,727 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.

redirect back to referrer

Any help appreciated.

Have users on the local area net work post to an Aspx page. The page
process some post data.

I would like to return the user's browser back to the sumbit page. I
have tried

hplReturn.NavigateUrl = Request.UrlReferrer.ToString

but get the following error:

"Object reference not set to an instance of an object"

Any help appreciated

DJ
Nov 18 '05 #1
2 2229
the first page opened doesnt have a referrer, so check if
request.UrlReferrer is nothing first. like:

if not request.UrlReferrer is nothing then
response.redirect (request.UrlReferrer.tostring)
end if

Bruno
"Hellp" <dj*****@citgo.com> wrote in message
news:7f************************@posting.google.com ...
Any help appreciated.

Have users on the local area net work post to an Aspx page. The page
process some post data.

I would like to return the user's browser back to the sumbit page. I
have tried

hplReturn.NavigateUrl = Request.UrlReferrer.ToString

but get the following error:

"Object reference not set to an instance of an object"

Any help appreciated

DJ

Nov 18 '05 #2
what if they directly typed the url or used the link from favourites...
there wont be no referrer.
so check for
first things first
if(!Page.IsPostback)
{
ViewState["URLReferrer"] = Request.UrlReferrer;
}

when you want to direct
if(ViewState["URLReferrer"] != null)
{
Response.Redirect(Convert.ToString(ViewState["URLReferrer"]))'
}
else
{
Response.Redirect("~");
// ~ redirect to current application's default page
}

--

Regards,

Hermit Dave
(http://hdave.blogspot.com)
"Hellp" <dj*****@citgo.com> wrote in message
news:7f************************@posting.google.com ...
Any help appreciated.

Have users on the local area net work post to an Aspx page. The page
process some post data.

I would like to return the user's browser back to the sumbit page. I
have tried

hplReturn.NavigateUrl = Request.UrlReferrer.ToString

but get the following error:

"Object reference not set to an instance of an object"

Any help appreciated

DJ

Nov 18 '05 #3

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

Similar topics

1
by: Paul Lee | last post by:
Hi all, I'm trying to redirect users from a specific domain to one of my webpages. So, in my example, anyone accessing my index.html from the *btinternet.com domain (allowing for wildcards!) will...
7
by: Donna Hawkins | last post by:
I want to use javascript to redirect to a URL which has been passed as a variable (in php). I have searched but cannot find any solution. I think this code is a basic redirect: <script...
2
by: jonathan | last post by:
Hi, I want to ask something. Say I have a homepage oldhomepage.com Then I have a new homepage called newhomepage.com Now, I set up a redirection in oldhomepage.com this.location =...
2
by: enterthe | last post by:
Hey, I have lots of visitors to my site from search engines, but they don't always get sent to the right page. So... based on the search query of the refering search page (e.g. google or...
15
by: Drebin | last post by:
I am retrofitting a central login application and want to be able to read the Request.ServerVariables so that when they have logged on, I can send them back to wherever they were trying to go.. ...
1
by: Trev | last post by:
Hi everyone, I'm trying to modify an existing piece of Javascript that will enable a redirect to a page based on IP address and/or keywords in the referrer; for instance, redirecting an existing...
5
by: Thom Little | last post by:
In ASP.NET 2.0 C# I need to redirect to an .ASP or .HTML page and include POST data (i.e., formatted like a form. The form data is changed dynamically by the C# page. Can anyone point me to an...
4
by: DGS | last post by:
Hi guys, Not a developer, but an admin so please pardon my ignorance. I have an issue that I was hoping to get help with. What I need is for the front page of my site to capture the URL that...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
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
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...

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.