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

Discussion in 'ASP .Net' started by jojoba@gmail.com, Jul 3, 2007.

  1. Guest

    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
     
    , Jul 3, 2007
    #1
    1. Advertising

  2. GroupReader Guest

    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.
     
    GroupReader, Jul 3, 2007
    #2
    1. Advertising

  3. Guest

    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
     
    , Jul 3, 2007
    #3
  4. Patrice Guest

    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

    <> a écrit dans le message de news:
    ...
    > 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
    >
    >
     
    Patrice, Jul 3, 2007
    #4
  5. Guest

    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
     
    , Jul 3, 2007
    #5
  6. Guest

    still stuck...
    please...anyone have any thoughts?
    thx so much
    matt
     
    , Jul 3, 2007
    #6
  7. GroupReader Guest

    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?
     
    GroupReader, Jul 3, 2007
    #7
  8. Guest

    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
     
    , Jul 3, 2007
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. SweatyFinger
    Replies:
    2
    Views:
    2,071
    Smokey Grindel
    Dec 2, 2006
  2. Leon Mayne
    Replies:
    5
    Views:
    4,797
    Leon Mayne
    May 27, 2008
  3. Abraham Luna

    hitting enter does not submit form but refreshes page?

    Abraham Luna, Sep 2, 2005, in forum: ASP .Net Web Controls
    Replies:
    5
    Views:
    339
    Abraham Andres Luna
    Oct 27, 2005
  4. Dwayne Madsen

    Q: Div A inside Div B is larger than Div B

    Dwayne Madsen, Jun 1, 2005, in forum: Javascript
    Replies:
    1
    Views:
    206
    David Dorward
    Jun 1, 2005
  5. 123Jim
    Replies:
    0
    Views:
    148
    123Jim
    May 16, 2011
Loading...

Share This Page