PreviousPage is null

B

Bryce

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?
 
S

Steve C. Orr [MCSD, MVP, CSM, ASP Insider]

I believe PreviousPage works if you use Server.Transfer, but not if you use
Response.Redirect.
 
B

Bryce

Steve said:
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top