473,324 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Postback not processing without Trace Mode

I have a situation where we have placed a composite webcontrol
(containing several buttons) on a webpage. The control has several
'OnClick' events wired up to the buttons, and handlers are placed in
the page's code-behind file. On a normal visit to the page, you click
one of the buttons, postback fires and the appropriate event handler
traps the OnClick event and processing continues as expected. All is
good.

The curious situation is this: from this page, if you click a standard
HTML hyperlink to access another area of the site, you get there no
problem (no postback involved). From the second page, if you click the
browser back button you are returned to the first page. This is the
expected behavior, all is good.

On the original page, if you attempt to press one of the buttons in the
composite control, the page posts back BUT the Page.IsPostBack property
is set to FALSE. Furthermore, if you inspect Request.Form for the
button that was pressed, you do receive the expected 'value' in the
Form collection.

We turned on ASP.NET trace mode to further troubleshoot this situation.
After going through the steps and clicking the back button, the
composite button control behaved as expected when a button was clicked.
The Page.IsPostback property contained TRUE, and the button 'OnClick'
event handler was properly fired.

Has anybody seen something like this before? Is the browser back
button skewing my viewstate or something? Any insight would be greatly
appreciated.

Aug 24 '06 #1
1 1347
if you click a button, the browser always sends the name. IsPostback is
determined from the viewstate, not the presence of the button name, so you
are on the correct track debugging the viewstate.

-- bruce (sqlwork.com)
<je***********@gmail.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
>I have a situation where we have placed a composite webcontrol
(containing several buttons) on a webpage. The control has several
'OnClick' events wired up to the buttons, and handlers are placed in
the page's code-behind file. On a normal visit to the page, you click
one of the buttons, postback fires and the appropriate event handler
traps the OnClick event and processing continues as expected. All is
good.

The curious situation is this: from this page, if you click a standard
HTML hyperlink to access another area of the site, you get there no
problem (no postback involved). From the second page, if you click the
browser back button you are returned to the first page. This is the
expected behavior, all is good.

On the original page, if you attempt to press one of the buttons in the
composite control, the page posts back BUT the Page.IsPostBack property
is set to FALSE. Furthermore, if you inspect Request.Form for the
button that was pressed, you do receive the expected 'value' in the
Form collection.

We turned on ASP.NET trace mode to further troubleshoot this situation.
After going through the steps and clicking the back button, the
composite button control behaved as expected when a button was clicked.
The Page.IsPostback property contained TRUE, and the button 'OnClick'
event handler was properly fired.

Has anybody seen something like this before? Is the browser back
button skewing my viewstate or something? Any insight would be greatly
appreciated.

Aug 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: tshad | last post by:
I have an upload file input as: <input id="MyFile" style="width:300px" type="File" runat="Server"> This works fine, but I find that if my page doesn't pass validation during postback, the page...
4
by: Jim Hammond | last post by:
It would be udeful to be able to get the current on-screen values from a FormView that is databound to an ObjectDataSource by using a callback instead of a postback. For example: public void...
2
by: Nathan Sokalski | last post by:
I have a DataList in which the ItemTemplate contains two Button controls that use EventBubbling. When I click either of them I receive the following error: Server Error in '/' Application....
2
by: Nathan Sokalski | last post by:
I have a DataList in which the ItemTemplate contains two Button controls that use EventBubbling. When I click either of them I receive the following error: Server Error in '/' Application....
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.