Export (0) Print
Expand All

Page.PreviousPage Property

Gets the page that transferred control to the current page.

Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)

'Declaration
Public ReadOnly Property PreviousPage As Page
'Usage
Dim instance As Page
Dim value As Page

value = instance.PreviousPage

/** @property */
public Page get_PreviousPage ()

public function get PreviousPage () : Page

Not applicable.

Property Value

The Page representing the page that transferred control to the current page.

Exception typeCondition

InvalidOperationException

The current user is not allowed to access the previous page.

When you use the Transfer method or cross-page posting to transfer processing from one ASP.NET page to another, the originating page contains request information that might be required for the destination page. You use the PreviousPage property to access that information

The PreviousPage property is a null reference (Nothing in Visual Basic) when the user requests that page directly from the server.

TopicLocation
How to: Pass Values Between ASP.NET Web PagesBuilding ASP .NET Web Applications
How to: Determine How ASP.NET Web Pages Were InvokedBuilding ASP .NET Web Applications
How to: Pass Values Between ASP.NET Web PagesBuilding ASP .NET Web Applications
How to: Determine How ASP.NET Web Pages Were InvokedBuilding ASP .NET Web Applications

The following example is in two parts. The first is an ASP.NET page that uses the Transfer method, exposed in the page model as Server.Transfer("path"). The second part is the target page, which uses the PreviousPage property to get the title of the first page.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft