Page one click behind

E

Edward

I have an aspx page with 2 web usercontrols (ascx). The
first user control (example a.ascx) has two buttons.
Clicking the first button sets a Session variable "myVar"
to "but1", the second sets the same variable to "but2".
The other ascx-module uses the session variable "myVar" to
determine what to display. When I click button 1 (or 2),
the other ascx-module doesn't change his contents. When I
click the button for the second time or click another
button, the contents of the ascx-module is changed
according to the contents for the first button clicked. I
know that the following event occurs: module1.page_load,
module2.page_load, module1.button_click. What must I do to
let module2 show the right text? Can I force a reload of
the page or what?

thanks in advance.
 
C

Cowboy \(Gregory A. Beamer\)

Certainly, you can force a refresh of the page, but I would look at the
order of events by stepping through with the debugger. It is likely you are
setting the values in the wrong order (allowing page render before changing
value, or similar). Set a watch in the debugger for any change in the
variable you want to look at and run through. You will see the code change
timing. When it breaks, check to see other vars and where the page is in
load.

I had a dev here that was rebinding controls prior to saving to the database
and wondering why changes were never being saved to the database. At the
time, the networking guys had us set where we could not debug, so it was
difficult to find these problems. Once we got debug capabilities, we found
the problem very quickly. It is likely your issue is similar (albeit
different issue, but similar reasoning).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

**********************************************************************
Think Outside the Box!
**********************************************************************
 

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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top