Postback not processing without Trace Mode

J

jeffreytfritz

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.
 
B

bruce barker \(sqlwork.com\)

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top