+2006-11-21 Igor Zelmanovich <igorz@mainsoft.com>
+
+ * Page.cs: fixed: PreviousPage property
+ when CrossPostBack is processed PreviousPage is initialized
+ only if PreviousPage property is called.
+
2006-11-21 Igor Zelmanovich <igorz@mainsoft.com>
* DataSourceControl.cs: fixed: Focus(), EnableTheming
private PageLifeCycle _lifeCycle = PageLifeCycle.Unknown;
private bool _eventValidation = true;
private object [] _savedControlState;
+ private bool _doLoadPreviousPage;
#endif
private bool _viewState = true;
private bool _viewStateMac;
// http://msdn2.microsoft.com/en-us/library/ms178141.aspx
if (_requestValueCollection != null) {
if (!isCrossPagePostBack && _requestValueCollection [PreviousPageID] != null && _requestValueCollection [PreviousPageID] != Request.FilePath) {
- LoadPreviousPageReference ();
+ _doLoadPreviousPage = true;
}
else {
isCallback = _requestValueCollection [CallbackArgumentID] != null;
isPostBack = !isCallback;
}
}
+
+ // if request was transfered from other page - track Prev. Page
+ previousPage = _context.LastPage;
+ _context.LastPage = this;
_lifeCycle = PageLifeCycle.PreInit;
OnPreInit (EventArgs.Empty);
[BrowsableAttribute (false)]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
public Page PreviousPage {
- get { return previousPage; }
+ get {
+ if (_doLoadPreviousPage) {
+ _doLoadPreviousPage = false;
+ LoadPreviousPageReference ();
+ }
+ return previousPage;
+ }
}
if (prevPage != null) {
previousPage = (Page) PageParser.GetCompiledPageInstance (prevPage, Server.MapPath (prevPage), Context);
previousPage.ProcessCrossPagePostBack (_context);
- } else {
- previousPage = _context.LastPage;
- }
+ }
}
- _context.LastPage = this;
}
#if DOT_NET\r
WebTest.CopyResource (GetType (), "MonoTests.System.Web.UI.WebControls.Resources.CrossPagePosting1.aspx", "CrossPagePosting1.aspx");\r
WebTest.CopyResource (GetType (), "MonoTests.System.Web.UI.WebControls.Resources.CrossPagePosting2.aspx", "CrossPagePosting2.aspx");\r
-#else
- WebTest.CopyResource (GetType (), "CrossPagePosting1.aspx", "CrossPagePosting1.aspx");
- WebTest.CopyResource (GetType (), "CrossPagePosting2.aspx", "CrossPagePosting2.aspx");
+#else\r
+ WebTest.CopyResource (GetType (), "CrossPagePosting1.aspx", "CrossPagePosting1.aspx");\r
+ WebTest.CopyResource (GetType (), "CrossPagePosting2.aspx", "CrossPagePosting2.aspx");\r
#endif\r
}\r
\r
\r
[Test]\r
[Category ("NunitWeb")]\r
- [Category ("NotWorking")]\r
public void CrossPagePosting_BaseFixture ()\r
{\r
WebTest t = new WebTest ("CrossPagePosting1.aspx");\r
\r
[Test]\r
[Category ("NunitWeb")]\r
- [Category ("NotWorking")]\r
public void CrossPagePosting_BaseFlow ()\r
{\r
// NOTE!!! Test user data assigned stright on aspx pages\r