P
PSY
I have an asp.net webpage.
On that page, there is an update panel with several check boxes in
it. Each of those check boxes has an autopostback="true" attribute
set and a method attached to it that performs some logic on the page.
When one of these events is fired, a partial postback is performed and
the code for that event and the page life cycle events fire
(Page_Init, Page_Load, etc,,,) In my Page_Init and Page_Load blocks,
there is code that should only be executed when the page is first
loaded. Hence, I performed a check for Page.IsPostBack andalso
ScriptManager.GetCurrent(Page).IsInAsyncPostBack during these phases.
Typically, if you click one of these checkboxes, the event fires and
both the IsPostBack and IsInAsyncPostBack values are true, so this
code doesn't execute (Exactly what is desired). However, if you
quickly click on a number of the checkboxes one after another,
eventually you will have your IsPostBack and IsInAsyncPostBack values
become false. I know this, because I have set breakpoints inside of
this section and have examined the values of those statements.
Does anyone have any ideas why I am having this issue?
For now, I would take a workaround if anyone has any. Basically what
I need is a bit flag that lets me know if this is my first access to
the page. I cannot use a viewstate boolean flag because I need it in
the Page_Init and we don't want to use the QueryString, because we
like to keep a clean URL here. Any Ideas?
On that page, there is an update panel with several check boxes in
it. Each of those check boxes has an autopostback="true" attribute
set and a method attached to it that performs some logic on the page.
When one of these events is fired, a partial postback is performed and
the code for that event and the page life cycle events fire
(Page_Init, Page_Load, etc,,,) In my Page_Init and Page_Load blocks,
there is code that should only be executed when the page is first
loaded. Hence, I performed a check for Page.IsPostBack andalso
ScriptManager.GetCurrent(Page).IsInAsyncPostBack during these phases.
Typically, if you click one of these checkboxes, the event fires and
both the IsPostBack and IsInAsyncPostBack values are true, so this
code doesn't execute (Exactly what is desired). However, if you
quickly click on a number of the checkboxes one after another,
eventually you will have your IsPostBack and IsInAsyncPostBack values
become false. I know this, because I have set breakpoints inside of
this section and have examined the values of those statements.
Does anyone have any ideas why I am having this issue?
For now, I would take a workaround if anyone has any. Basically what
I need is a bit flag that lets me know if this is my first access to
the page. I cannot use a viewstate boolean flag because I need it in
the Page_Init and we don't want to use the QueryString, because we
like to keep a clean URL here. Any Ideas?