Re: Page_Load call during POSTBACK
- From: "Olivier Matrot" <olivier.matrot.rte@xxxxxxxxxxxxx>
- Date: Wed, 22 Jun 2005 16:13:24 +0200
I'v not tried Application_BeginRequest yet.
Call order seen by writing to a log file function name :
1) ItemCreated
2) FilterOperandFromlstColumnId_New
3) Page_Load.
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:%23VXzn0ydFHA.4060@xxxxxxxxxxxxxxxxxxxxxxx
> First, have you tried the Application_beginRequest idea?
>
> I'm a little confused by the 2nd part. You say that ItemCreated is called
> before FilterOperandFromlstColumnId_Updated, which is what should be
> happening. Page_Load is called before ItemCreated... seems like everything
> works according to plan..
>
> Karl
>
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/ - New and Improved (yes, the popup is
> annoying)
> http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
> come!)
> "Olivier Matrot" <olivier.matrot.rte@xxxxxxxxxxxxx> wrote in message
> news:eqDZFfydFHA.3932@xxxxxxxxxxxxxxxxxxxxxxx
>> I'm able to reproduce the problem for the postback handler.
>> To be more specific, a combobox inside a datagrid Item (Footer or
>> EditItem) is marked to autopostback on event "OnSelectedIndexChanged" :
>>
>> From ASPX file :
>> ......
>> <FooterTemplate>
>> <asp:DropDownList id=lstColumnId_New AutoPostBack="True" Runat="server"
>> OnSelectedIndexChanged="FilterOperandFromlstColumnId_New"
>> DataValueField="ColumnId" DataTextField="ColumnName" DataSource="<%#
>> GetColumns() %>">
>> </asp:DropDownList>
>> </FooterTemplate>
>> <EditItemTemplate>
>> <asp:Label id=lblColumnID_Original runat="server" Visible="False"
>> text='<%#DataBinder.Eval(Container.DataItem, "ColumnId")%>'>
>> </asp:Label>
>> <asp:DropDownList id=lstColumnId_Updated AutoPostBack="True"
>> Runat="server"
>> OnSelectedIndexChanged="FilterOperandFromlstColumnId_Updated"
>> DataValueField="ColumnId" DataTextField="ColumnName" DataSource="<%#
>> GetColumns() %>">
>> </asp:DropDownList>
>> </EditItemTemplate>
>> ......
>>
>> Below is code taken from InitializeComponent about the Datagrid :
>> this.grdFilterDetails.ItemCreated += new
>> System.Web.UI.WebControls.DataGridItemEventHandler(this.grdFilterDetails_ItemCreated);
>>
>> this.grdFilterDetails.ItemCommand += new
>> System.Web.UI.WebControls.DataGridCommandEventHandler(this.grdFilterDetails_ItemCommand);
>>
>> this.grdFilterDetails.CancelCommand += new
>> System.Web.UI.WebControls.DataGridCommandEventHandler(this.grdFilterDetails_CancelCommand);
>>
>> this.grdFilterDetails.EditCommand += new
>> System.Web.UI.WebControls.DataGridCommandEventHandler(this.grdFilterDetails_EditCommand);
>>
>> this.grdFilterDetails.UpdateCommand += new
>> System.Web.UI.WebControls.DataGridCommandEventHandler(this.grdFilterDetails_UpdateCommand);
>>
>> this.grdFilterDetails.ItemDataBound += new
>> System.Web.UI.WebControls.DataGridItemEventHandler(this.grdFilterDetails_ItemDataBound);
>>
>>
>> Here is the call stack when the postback function is called :
>>
>>> rtefaxqueues.dll!RTEFaxQUEUES.Filters.FilterOperandFromlstColumnId_New(System.Object
>>> sender = {System.Web.UI.WebControls.DropDownList}, System.EventArgs e =
>>> {System.EventArgs}) Line 671 C#
>> [<Non-user Code>]
>>
>> Note that ItemCreated event is called before the one above.
>>
>> TIA.
>>
>> "Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
>> wrote in message news:%23bwhayxdFHA.2520@xxxxxxxxxxxxxxxxxxxxxxx
>>> Olivier:
>>> First off, I would probably put code like that int he
>>> Application_BeginRequest of the Global.asax or an http module. This
>>> will ensure that it's set up before any page events fire.
>>>
>>> As for the page_load situation, it SHOULD always fire BEFORE the
>>> postback handler. If it doesn't, there's something very wrong. Is it
>>> consistent for a given page? Perhaps some code would help solve the
>>> problem...
>>>
>>> Karl
>>>
>>> --
>>> MY ASP.Net tutorials
>>> http://www.openmymind.net/ - New and Improved (yes, the popup is
>>> annoying)
>>> http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
>>> come!)
>>>
>>>
>>> "Olivier Matrot" <olivier.matrot.rte@xxxxxxxxxxxxx> wrote in message
>>> news:e8K4mZwdFHA.1288@xxxxxxxxxxxxxxxxxxxxxxx
>>>> Hello,
>>>> This has probably been asked several times, but It must be clarified
>>>> for me.
>>>>
>>>> I would like to know why sometimes during a postback Page_Load is
>>>> called after the function marked for postback.
>>>> Here's the deal : From now on, I set CurrentThread.CurrentCulture only
>>>> during PageLoad. so date and currency format is incorrect if page load
>>>> is not called first.
>>>> What should I do to ensure that CurrentThread.CurrentCulture is alway
>>>> set correctly as soon as a postback is hit.
>>>> TIA.
>>>>
>>>
>>>
>>
>>
>
>
.
- Follow-Ups:
- Re: Page_Load call during POSTBACK
- From: Steven Cheng[MSFT]
- Re: Page_Load call during POSTBACK
- References:
- Page_Load call during POSTBACK
- From: Olivier Matrot
- Re: Page_Load call during POSTBACK
- From: Olivier Matrot
- Page_Load call during POSTBACK
- Prev by Date: Re: Desing Question
- Next by Date: Re: How do i add a cleint side button to a table?
- Previous by thread: Re: Page_Load call during POSTBACK
- Next by thread: Re: Page_Load call during POSTBACK
- Index(es):