Affecting controls outside an UpdatePanel during an Ajax server request

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?

Thanks!
robaherneAsked:
Who is Participating?
 
David RobitailleConnect With a Mentor Analyst ProgrammerCommented:
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.
0
 
ajollyCommented:
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);
0
 
robaherneAuthor Commented:
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
0
All Courses

From novice to tech pro — start learning today.