views:

442

answers:

3

I have a Repeater with an ASP.NET AJAX 1.0 UpdatePanel inside it. There are buttons outside of the UpdatePanel but still in the repeater. When a section inside the UpdatePanel appears (it's a hidden Panel control that appears when user answers a question a certain way), the buttons at the bottom disappear.

Here is an illustration.

[REPEATER]
  [UPDATEPANEL]
     [QUESTION]   <-- when user says yes, Panel appears
     [PANEL]
  [/UPDATEPANEL]
  [TABLE]         <-- This table is no longer visible.
     [Button]
  [/TABLE]
[/REPEATER]

If I move the table to the top of the page, the content does not disappear, so I suspect it is a style issue, where the controls are actually there, but are underneath the content of the UpdatePanel. I've tried adding a <br clear="all"/> to just before the table, to no avail.

Any idea how I might fix this?

Edit: I had an errant missing closing tag that caused the UpdatePanel to extend further than it should've, so it was hiding my control. Using the Firefox plugins helped identify this.

+2  A: 

My suggestion is to use Firefox and the Web Developer toolbar to do a View Generated Source after the update has occurred or inspect the elements with Firebug. If the table html is still on the page, then it could be either a style issue or an issue with malformed HTML in the panel causing the table not to render properly. If the table html is missing, then it is being removed from the DOM (or overwritten) by the AJAX callback. You might be able to use Firebug to debug the actual AJAX callback as well to see what and when things are actually being replaced.

Posting the generated HTML before and after the update in your question would also be helpful if you still can't figure things out and want more input.

tvanfosson
Thanks, that was helpful. The table actually disappears, which makes it seem like the UpdatePanel is overstepping its bounds.
paulwhit
A: 

Put the table inside the updatepanel, or put the whole repeater in one updatepanel.

tsilb
It's very large, so I need to avoid this since it sends a lot of content over the wire.
paulwhit
A: 

Note that the Clear attribute is Deprecated as of HTML 4.01, and isn't included in XHTML Strict - what document type are you using - if you're using strict (and you're clearly using XHTML of some kind, because you've closed your br), then your browser has every right to ignore the clear attribute.

You would be better off doing this with CSS:

<style type="text/css">
  .cleaner{
    clear: both;
  }
</style>

<br class="cleaner" />

Also, you could try putting the br after the panel, so that it comes back in the UpdatePanel and forces the browser to honour it.

Zhaph - Ben Duguid
thanks for the tip. My issue is something else but this is good knowledge as well.
paulwhit