473,809 Members | 2,740 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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>
...
<authenticati on mode="Forms" />
...
</system.web>
<location path="SearchRes ults.aspx">
<system.web>
<authorizatio n>
<deny users="?" />
</authorization>
</system.web>
</location>
</configuration>

The login form uses the System.Web.UI.W ebControls.Logi n 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 8568
I believe PreviousPage works if you use Server.Transfer , but not if you use
Response.Redire ct.

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
"Bryce" <ne******@berze rker-soft.comwrote in message
news:96******** *************** *******@giganew s.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>
...
<authenticati on mode="Forms" />
...
</system.web>
<location path="SearchRes ults.aspx">
<system.web>
<authorizatio n>
<deny users="?" />
</authorization>
</system.web>
</location>
</configuration>

The login form uses the System.Web.UI.W ebControls.Logi n 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.Redire ct.
Thanks. But do I have the option of controling which mechanism it uses
to transfer to the intended control using the
System.Web.UI.W ebControls.Logi n control and the asp.net authentication?
Apr 23 '07 #3
Yes.
And you might also be able to use Request.URLRefe rrer 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******@berze rker-soft.comwrote in message
news:Pu******** *************** *******@giganew s.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.Redire ct.

Thanks. But do I have the option of controling which mechanism it uses to
transfer to the intended control using the System.Web.UI.W ebControls.Logi n
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.URLRefe rrer 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
3317
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 time. I can't seem to get at the Placeholder from the target page. The first page has an empty placeholder, and the code-behind loads a user control dynamically and adds it to the placeholder. The user control grabs an ID from the querystring...
3
1313
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
2557
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 - Server.Transfer("/Site/Template.aspx", true) - to a template page which displays the database related content. The Template page knows it's content because the page does exist in the SQL sitemap provider. The problem comes in with a button on...
2
1737
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 intellisense. It acts like it is not a class but compiles fine. Thanks, protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack)
0
1093
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 an array MostHits = ArrMH; } public String MostHits {
1
1272
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: ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.en/dv_aspnetcon/html/fedf234e-b7c4-4644-a9e8-c1c0870b043b.htm I do not see any deviations from the paosted code, yet the application throws an : "Object reference not set to an instance of an object." error Any suggestions would be appreciated. My complete code for both pages...
1
1340
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 (Page.PreviousPage Is Nothing) Then Label1.Text = "Form sent" If Not (Page.IsCrossPagePostBack) Then If IsNothing(PreviousPage.FindControl("txtVertrek"))
2
2672
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
2282
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 value without me being bothered about security et al. But what I find is once the page is posted the only controls that I get in PreviousPage is the master page and none of the controls of the content page are available in PreviousPage.Controls...
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9600
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10376
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10114
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9198
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7651
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3860
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.