I am trying to pass a value between two pages. However on my target page, the value is not found.
My source page includes the following code.
Public ReadOnly Property SQLString() As String
Get
Return “SELECT * FROM City”
End Get
End Property
On my target aspx page I have included the following directive:
<%@ PreviousPageType VirtualPath="~/tools/SearchResults.aspx"%>
In the target page code behind I have included the following in the page load:
Me.Master.Page.PreviousPage.SQLString
However, Visual studio complains that, SQLString is not a member of System.Web.Ui.page.
I must note I am useing master pages, and vaguely recall this causing an issue when accomplishing this in the past. Anyone have any ideas?
You need to cast the page to whatever type it actually is.
In the code behind of your source page you will have a class declaration like the following: