Affecting controls outside an UpdatePanel during an Ajax server request

Posted on 2008-11-04
Last Modified: 2010-04-21
I have an UpdatePanel that periodically checks a database for changes. When a particular change is detected i'd like to change the visible property of a Panel outside of the UpdatePanel to false. I guess this requires a page postback/refresh of some kind... but since Ajax only refreshes bits of the page, it has no effect.

The way I was thinking to solve it was to do something like this...

if (condition is met)
    somePanel.Visible = false;
    force page postback ????????

That way i'm thinking it'll reload the page and take into account the property changes to the Panel. How do I force a page refresh from the code behind? or is there some other way of doing this that I'm missing?

Question by:robaherne
    LVL 7

    Expert Comment

    I will suggest you to use ScriptManager.RegisterStartupScript, and use a javascript code here to make the panel invisible.

    ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "JAVA SCRIPT CODE", false);
    LVL 18

    Accepted Solution

    you could put the other panel in a other update panel. make sure it set to contitional and childrenastrigger = false.
    when you change the visibylity of the panel, call the other update panel`s update() function.

    Author Closing Comment

    Thanks! I ended up just including the Panel I wanted to make invisible in the original UpdatePanel... your way would work better tho. I'll give it a go

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now