Well have you tried to display Page.IsPostBack as asked previously ? How do
you know for sure that this code runs. Sorry for being picky but sometimes
we start from the assumption that a portion of code runs when actually it is
some other portion that does the job or because the code doesn't need to run
to get the same effect....
I would like to make 100% sure that IsPostBack doesn't return the correct
value. The best way is to just print this value to see wether or not it is
false. You could also dump Request.ServerVariables("HTTP_METHOD") to see if
it"'s GET or POST.
For example if you have some other code that does a redirect once the
postback for login occurs (which is perhaps the case with the standard
RedirectFromLogin method) then you would have a postback that does a
redirect and finally you are not seeing a postback in your code (i.e. you'll
see postback being false and the method being GET)...
--
Patrice
<an***********@googlemail.coma écrit dans le message de news:
11**********************@n60g2000hse.googlegroups. com...
Hi all,
Thanks for your replies but i still think im not being clear.. on
default.aspx i have the following code
if (!Page.IsPostBack)
{
string page;
if (Request.QueryString["PageID"] != null)
page = Request.QueryString["PageID"].ToString();
}
Obviously this code runs the first time the page loads, then when
someone logs in they press the submit button in the login control on
the masterpage causing the page to "postback". However when this
"postback occurs the above code runs when i thought the if (!
Page.IsPostBack) would stop the code running as i have just posted the
page from the login ox.. Why does this code run??
Cheers
Anthony