server transfer and previous page refference issue

  • Thread starter Thread starter Yankee Imperialist Dog!
  • Start date Start date
Y

Yankee Imperialist Dog!

i have two pages with a shared master page
i'm using server transfer to get to the other page.
page1, page2;
on load in page 2
i have:
if (!IsPostBack)
{
var ppg = PreviousPage as Page1;
}
the designer understands that Page1 exists
but when i compile i get an error: CS0246: The type or namespace name
'Page1' could not be found (are you missing a using directive or an assembly
reference?)

if i use only
var ppg = PreviousPage;
and debug on that line, or the next. It is clearly set to Page1 and has all
the values associated with it.

note that i'm getting a compile error not a runtime error.

What am i doing wrong or what do i need to include????

Thanks
KES
 
I have no idea why this happened, but i killed the page and started over.
It is exactly the same, ans far as i can tell, but now it works
 
BTW: the best way i've found so far to handle complex business objects on a
server transfer or a corsspage postback is to just create a property of
type "complexbusinessobject"
public SSOrder CurrentSSOrder { get; set;}

on button click if all is valid
CurrentSSOrder = oqcss;
Server.Transfer("OrderComplete.aspx", true);

...........
just do this on the second page
if(!IsPostBack)
{
var oqcss = ((OE01) PreviousPage).CurrentSSOrder;
Label1.Text = oqcss.Hed.FullName;
}
 
Back
Top