Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > why does updating a div inside of an updatepanel still refreshes entire page?!?!!

Reply
Thread Tools

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

 
 
jojoba@gmail.com
Guest
Posts: n/a
 
      07-03-2007
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

 
Reply With Quote
 
 
 
 
GroupReader
Guest
Posts: n/a
 
      07-03-2007
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.

 
Reply With Quote
 
 
 
 
matthew.sibigtroth@gmail.com
Guest
Posts: n/a
 
      07-03-2007
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


 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      07-03-2007
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

--
Patrice

<(E-Mail Removed)> a écrit dans le message de news:
(E-Mail Removed). com...
> 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
>
>



 
Reply With Quote
 
matthew.sibigtroth@gmail.com
Guest
Posts: n/a
 
      07-03-2007
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

 
Reply With Quote
 
matthew.sibigtroth@gmail.com
Guest
Posts: n/a
 
      07-03-2007
still stuck...
please...anyone have any thoughts?
thx so much
matt

 
Reply With Quote
 
GroupReader
Guest
Posts: n/a
 
      07-03-2007
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?


 
Reply With Quote
 
jojoba@gmail.com
Guest
Posts: n/a
 
      07-03-2007
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







 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
drag div from inside div to inside another 123Jim Javascript 0 05-16-2011 08:36 AM
File upload inside a usercontrol inside an updatepanel Leon Mayne ASP .Net 5 05-27-2008 09:02 AM
refresh an updatePanel in an other updatePanel fran_j_diaz@yahoo.fr ASP .Net 3 08-08-2007 06:30 AM
findcontrol("PlaceHolderPrice") why why why why why why why why why why why Mr. SweatyFinger ASP .Net 2 12-02-2006 03:46 PM
Q: Div A inside Div B is larger than Div B Dwayne Madsen Javascript 1 06-01-2005 03:02 PM



Advertisments