why does updating a div inside of an updatepanel still refreshes entire page?!?!!

J

jojoba

hi everyone!
i'm serving up an asp.net page using ajax futures.

long story short:
i have two update panels.
one has a webpage in it (e.g. www.google.com).
the other has an image inside of a div.
however, when i update the div in code behind ( via
UpdatePanel_div.Update() ), the entire page refreshes.
if i change the div to an iframe, then the entire page does not
refresh, only the iframe (like i want).
im not sure what's going on here....is there something special about
div's?
thanks to anyone who has some ideas on this one.
btw...please let me know if you need more info.
thanks,
jojoba
 
G

GroupReader

When you call UpdatePanel_div.Update( ) from the code-behind, you are
already in the middle of a postback, right? What's the trigger
(control) that caused the postback? Try putting that control inside
an updatePanel also (with children as triggers false and update
conditional). OR try just declaring that control as a "trigger" for
your UpdatePanel_div.
 
M

matthew.sibigtroth

hi and thx for the help!

you said:
<<<<
What's the trigger (control) that caused the postback? Try putting
that control inside an updatePanel also (with children as triggers
false and update conditional). OR try just declaring that control as
a "trigger" for your UpdatePanel_div.
The control is a Standard Button.
This button is in the same UpdatePanel (UpdatePanel_remoteWebPage)
that contains a webpage inside (e.g. www.google.com), .
The button is a trigger ONLY for the UpdatePanel_div.
So i have tried your second suggestion to no avail <sad face>.
And i just tried your second suggestion to no avail (putting the
"trigger" button into its own update panel, and setting the trigger
params) <sadder face>
Perhaps this is a bug?
Is the div maybe covering the whole screen or something....and that's
why im getting the full refresh...(i have set the size of the div tho
to be like 100 x 100)

Any other avenues perhaps?
Thx again,
jojoba
 
P

Patrice

Add perhaps a visible border around your updatepanel as well as a date
outside of the updatepanel.

It would confirm wether or not you are seeing a full refresh or if it
refresh just the needed part but of course if this part contains a lot of
things all those things are refreshed making you think the whole page is
refreshed...

Also you could test in a bare bone page to see if it works as expected :
- either it works and you could find by adding something more similar to
your final code what is the final culprit
- or you'll have a bare bone sample that shows the problem to submit so that
we can see easily (please keep the sample to the minimal amount of code that
shows the problem) see how you are doing the update
 
M

matthew.sibigtroth

Thanks Patrice!

Tried your suggestion to better localize the issue.
I put a label outside of the UpdatePanels.
I set its text in code-behind, right before i update the
UpdatePanel_div, and the text does NOT change in the browser.
This means to me that although the entire page appears to flicker, i
am still only updating the UpdatePanel_div (that's good!)
So then, the question now is, why the heck is the entire page
flickering when we have just shown that ONLY the UpdatePanel_div is
updating?
Thnx to all,
jojoba
 
G

GroupReader

Your said you were calling the updatePanel's update() method
explicitly *and* you have a button as a trigger. That's not how I do
it.

I do one of the following:

A) set a control as a trigger for your update panel. Then you don't
need to call "update()" yourself in the codebehind. I think this is
how it works normally, out-of-the-box.

B) Here's what I like best: Create updatePanels anywhere on your
page you want. Make sure they are all "conditional" and make sure you
DO NOT define any triggers. Make sure children as triggers is false.
Then, in the code-behind, call UpdatePanel.Update() method to tell
asp.net to refresh only the proper updatePanel and not the rest of the
page whenever you want. This seems to work really well.

To answer one of your original questions: there is definitely nothing
special about a div that would mess up the updatePanel.

My question: I don't really understant what you mean by "one of the
updatePanels has a webpage in it"? What, technically speaking, does
that mean? Are you using an IFrame? Are you fetching html from a
page and inserting it into a div for it to be rendered?
 
J

jojoba

Hi again


GroupReader said:
Here's what I like best: Create updatePanels anywhere on your
page you want. Make sure they are all "conditional" and make sure you
DO NOT define any triggers. Make sure children as triggers is false.
Then, in the code-behind, call UpdatePanel.Update() method to tell
asp.net to refresh only the proper updatePanel and not the rest of the
page whenever you want. This seems to work really well.

That's sounds like great advice (why update twice, right?).
I implemented those changes.....Still got that darn update problem
(arg!)


GroupReader said:
My question: I don't really understant what you mean by "one of the
updatePanels has a webpage in it"? What, technically speaking, does
that mean? Are you using an IFrame? Are you fetching html from a
page and inserting it into a div for it to be rendered?

Yep, i am using a dynamically generated iframe:
Frame = HtmlGenericControl('iframe')
Then i point the src attribute to whatever url i want:
Frame.Attributes.Add("src", "http://www.google.com")
That works great.
What stinks is that when i overlay a div on the iframe, and then tell
the UpdatePanel containing the div to update, the whole page flashes.

Kinda confusing....especially since if i change the div to an iframe,
i do not get an flash across the entire page....the update works as
expected

any thoughts.
thx again,
jojoba
 

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,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top