Updating Control outside Update pannel
-
Hello, I have one treeview in updatepanel and one asp pannel(with visible = "false") out-side updatepanel. On selectedIndexchanged of treeview, I want a pannel outside of updatepanel needs to be visible. But it is not working. Is there any work around so that I can make my pannel visible w/o postback? Thanks in advance. Regards, Milind.
-
Hello, I have one treeview in updatepanel and one asp pannel(with visible = "false") out-side updatepanel. On selectedIndexchanged of treeview, I want a pannel outside of updatepanel needs to be visible. But it is not working. Is there any work around so that I can make my pannel visible w/o postback? Thanks in advance. Regards, Milind.
If it's not inside an update panel, then you'd need to write your own javascript to make it visible.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Hello, I have one treeview in updatepanel and one asp pannel(with visible = "false") out-side updatepanel. On selectedIndexchanged of treeview, I want a pannel outside of updatepanel needs to be visible. But it is not working. Is there any work around so that I can make my pannel visible w/o postback? Thanks in advance. Regards, Milind.
All the content that is inside the Update panel will be posted back to the client and refreshed in the client as response. So it is impossible to update controls outside updatepanel from the server. As Christian suggested, you need to pass some Javascript to the client which might show the Panel. But there is another scenario. ASP.NET doesnt render controls that are made Visible=false. So from client side using javascript, you will not going to find the control. So the solution will be : 1. Use
pnl.Style.Add(HtmlTextWriterStyle.Display, "none")
to make the panel invisible instead ofpnl.Visible=false
//To ensure that pnl is rendered in the client. 2. In postback of UpdatePanel useRegisterStartupScript
to pass a javascript that resets the pnl.style. Your javascript might look like"document.getElementById('" + pnl.ClientId + "').style.display='none';"
:-DAbhishek Sur **Don't forget to click "Good Answer" if you like this Solution.
My Latest Articles-->** Simplify Code Using NDepend
Basics of Bing Search API using .NET
Microsoft Bing MAP using Javascript -
Hello, I have one treeview in updatepanel and one asp pannel(with visible = "false") out-side updatepanel. On selectedIndexchanged of treeview, I want a pannel outside of updatepanel needs to be visible. But it is not working. Is there any work around so that I can make my pannel visible w/o postback? Thanks in advance. Regards, Milind.
Or you could put ASP:Panel inside another update Panel and set it's update mode to Always, But I think javascript will still be better