473,385 Members | 2,210 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.

PreviousPage is null

I have a search page that submits to a search results page. I have set
the search results page to be authenticated, so when the user first
tries to search, it redirects them to a login screen. When they log in,
it goes to the search result screen. But when I do, the PreviousPage
variable is null.

Once logged in, when I go from the search to the search results screen,
PreviousPage is fine.

I'm using the authentication built into dot net using the following in
my web.config file:

<configuration...
<system.web>
...
<authentication mode="Forms" />
...
</system.web>
<location path="SearchResults.aspx">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
</configuration>

The login form uses the System.Web.UI.WebControls.Login control.

I'm assuming that this uses a redirect? And this is why I'm losing the
PreviousPage? Any way around this other than putting the search
information in a session variable?
Apr 23 '07 #1
4 8552
I believe PreviousPage works if you use Server.Transfer, but not if you use
Response.Redirect.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Bryce" <ne******@berzerker-soft.comwrote in message
news:96******************************@giganews.com ...
>I have a search page that submits to a search results page. I have set the
search results page to be authenticated, so when the user first tries to
search, it redirects them to a login screen. When they log in, it goes to
the search result screen. But when I do, the PreviousPage variable is null.

Once logged in, when I go from the search to the search results screen,
PreviousPage is fine.

I'm using the authentication built into dot net using the following in my
web.config file:

<configuration...
<system.web>
...
<authentication mode="Forms" />
...
</system.web>
<location path="SearchResults.aspx">
<system.web>
<authorization>
<deny users="?" />
</authorization>
</system.web>
</location>
</configuration>

The login form uses the System.Web.UI.WebControls.Login control.

I'm assuming that this uses a redirect? And this is why I'm losing the
PreviousPage? Any way around this other than putting the search
information in a session variable?
Apr 23 '07 #2
Steve C. Orr [MCSD, MVP, CSM, ASP Insider] wrote:
I believe PreviousPage works if you use Server.Transfer, but not if you
use Response.Redirect.
Thanks. But do I have the option of controling which mechanism it uses
to transfer to the intended control using the
System.Web.UI.WebControls.Login control and the asp.net authentication?
Apr 23 '07 #3
Yes.
And you might also be able to use Request.URLReferrer depending on your
needs.
Here's more info on that:
http://idunno.org/articles/279.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net

"Bryce" <ne******@berzerker-soft.comwrote in message
news:Pu******************************@giganews.com ...
Steve C. Orr [MCSD, MVP, CSM, ASP Insider] wrote:
>I believe PreviousPage works if you use Server.Transfer, but not if you
use Response.Redirect.

Thanks. But do I have the option of controling which mechanism it uses to
transfer to the intended control using the System.Web.UI.WebControls.Login
control and the asp.net authentication?
Apr 23 '07 #4
Steve C. Orr [MCSD, MVP, CSM, ASP Insider] wrote:
Yes.
And you might also be able to use Request.URLReferrer depending on your
needs.
Here's more info on that:
http://idunno.org/articles/279.aspx
Thanks. That helped a lot.
Apr 25 '07 #5

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

Similar topics

4
by: Alan Silver | last post by:
Hello, I'm doing a cross page post, and want to pick up information from the previous page. The problem is that the previous page contains a user control that is loaded into a Placeholder at run...
3
by: Kel Good | last post by:
I'm wondering if the PreviousPage property is only populated when a page is cross posted on the same server, or will this work in a web farm situation. Thanks. Kel
1
by: michael.neel | last post by:
Here is the setup: I have an SQL driven sitemap provider - when the user clicks on a database generated link - /Site/DBPages/Article1.aspx - a handler does a Server.Transfer -...
2
by: PeterKellner | last post by:
Is there something extra I need to do to make intellisense work when referencing a page class? Here is my working Page_Load from a aspx page. sourcePage does not get it's members listed with...
0
by: Jim McGivney | last post by:
I am trying to use the PreviousPage feature in asp.net 2.0 On the source (previous page) I have: protected void Page_Load(object sender, EventArgs e) { ..... Code to populate ArrMH //ArrMH is...
1
by: Jim McGivney | last post by:
I have been trying to get the values from a previous page on my target page. I have followed the help article:...
1
by: jeroen.bolle | last post by:
I'm trying to pass variables between pages using the post method. I have access to the the page where I've posted my form, but all the objects are empty... An extract of the code: If Not...
2
by: David C | last post by:
Will the Page.PreviousPage be able to read controls from a non-aspx page, e.g. an html page? Is there a better way to get info. from textboxes/controls? Thanks. David
10
by: rjvrnjn | last post by:
I'm trying to pass a variable value from one page to another. Of all the ways that are available, I like the PreviousPage.FindControl() one as it lets me access the previous page controls and get the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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.