On pippo.aspx and pippo2.aspx pages (Webform, .NET 3.5) I have this code, in the Page_Load :
Response.Write("Result: " + Page.PreviousPage.Request["idconcorso"] + "");
Well, I call pippo.aspx, and the result is Result:.
Than, I call from pippo.aspx the page pippo.aspx?idconcorso=1234 , and I aspect the result is again Result:, but in fact it print Result: 1234.
Than, I call from pippo.aspx?idconcorso=1234 the page pippo2.aspx, and there I aspect Result: 1234 , but in fact is Result:.
Where am I wrong?
P.S. when I say “call” I mean a simple <a href>
Your use of
Page.PreviousPageisn’t correct.It is designed to be used with the Transfer method or cross-page posting.
Source: http://msdn.microsoft.com/en-us/library/system.web.ui.page.previouspage.aspx
So making a direct page request as you’re doing won’t give you the values from the previous page.