I have a control inside of an UpdatePanel
. The UpdatePanel
has an AsyncPostBack
trigger associated with the inner control. This works just fine.
I have another control containing a SSRS ReportViewControl
that I would like to conditionaly hide based on the results from the postback event of the UpdatePanel
mentioned above.
The ReportViewerControl
is not inside of an UpdatePanel
and I would like to keep it this way. How can I hide the ReportViewerControl
based on the postback event of an UpdatePanel
inside of another control?
I am assuming that many problems would spring up if I place the ReportViewerControl
inside of an UpdatePanel
, anyone know for sure?
You could create a script inside you update panel content template and hide your control form javascript.
UpdatePanel
around the other content that you want to hide. (You can't make the current one bigger, but making a second shouldn't cause problems.) Have that second update panel set the same button as the trigger. (You can have a trigger that's outside of the update panel, you just can't update content outside of the update panel.) If the update is conditional (you only sometimes change the content when the button is clicked) then you can set the only trigger for the second panel to be a hidden button which youClick
in code from the handler of the first button click.You can use following code after processing the Async AJAX call on server and just before returning the response to client/browser
I assume you have scriptmanager placed on the ASPX page
I did a simple trick. I created a another Updatepanel and put a literal control side the update panel and this update panel code Is Above the "Control you want to hide"
something like this
Then in Code behind I inject CSS
something like this
This seems to be working. Basically literal control is injecting style tag and browser is very quick to react.
but do read about this . Using <style> tags in the <body> with other HTML