Cant create instance of previous page class

majicmonk

Member
Joined
Jul 21, 2009
Messages
8
Programming Experience
Beginner
Hi i'm trying to create an instance of a page called PostedFrom in the codebehind file of a page called ReceivesPostBack, so I can access the information posted across, as shown below:

dim prevpage as PostedFrom
prevpage = trycast(PreviousPage, PostedFrom)


I'm getting error: Type 'PostedFrom' is not defined.

The only away around it so far was to add the below to the aspx file.

<%@ PreviousPageType VirtualPath="~/StateManagement/cross page posting/PostedFrom.aspx" %>


This isnt ideal, as I may want to post to one page from different pages.

Can anyone tell me what i'm doing wrong and how I can fix it. I'm using visual studio 2008.

Thanks

Mik
 
Last edited:
Quick Update

After a bit of testing I have found that this only happens when choosing, File/New Website and not when using File/New Project.

Is this normal? Is the New Website option only intended for sites whose pages have minimal interaction?
 
Back
Top