Link to home
Start Free TrialLog in
Avatar of cophi
cophi

asked on

ASP.NET 2.0 Control Javascript IFRAME

I have an asp.net 2.0 ReportViewer control.  Even if you have never used this control you could probably help me with my problem.  I have this control included on my webpage, along with some other dropdowncontrols.  On postback of one of the dropdown controls, apparantly this causes the reportviewer to dispose and has to be recreated.  This isn't desired.  So my two inital thoughts were to cache the reportviewer and then set it back but you would notice a flickr.  My other thought was to put this in an iframe.  But I need to pass ReportParameters to this page?  How would I do this?  Could I do this in Javascript to send an actual object?  I'm leaning towards the IFRAME solution but I do not know how to pass this ReportParameters object to my page within the IFRAME.
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

The IFRAME does not really help because it brings new problems by handling TWO windows with separate documents and forms.

The solution for not refreshing the page would be AJAX, but that is only a buzz word when you did not use it before. It brings you more problems then solutions.

So I do not know how to help you easily :(

Avatar of stanscott2
stanscott2

I really don't advise you to use an IFRAME, because you'll spend a lot of time and effort trying to force this into the overall ASP.NET 2.0 framework, and I'm not sure it will work anyway.

The solution to this, I think, is in the ASP.NET code that uses the ReportViewer control.  If you don't need to redraw the ReportViewer, you should be doing something like:

if (!IsPostback)
{
     // code to bind the ReportViewer control to the data
}
// otherwise nothing

in C#.

However, postback always causes the page to reload, unless you're using AJAX, so there will always be SOME flicker (less than ideal, I know).

If you're stuck and want to post some of your ASP.NET code, I'll be happy to take a look at it.
Avatar of cophi

ASKER

Ok well I have a asp.net 2.0 report viewer control that I do NOT want to be reload/refresh on Postback so what is the best method for doing this.  i figured putting this control in a seperate frame would be best?  any better ideas?
Avatar of cophi

ASKER

basically i have 5 controls on the page... a few of them cause a post back.... but i want the report viewer control to keep the same state, I don't want it to reload.  see what i'm saying
Yes, I understood your problem before, and I suggested that you need to revise your ASP.NET code.  If you show some of it, I can maybe help you with more specifics.
Avatar of cophi

ASKER

stanscott2,

I understand what your are saying with your code example.  the problem is when one of the controls refreshs the page, the report viewer is going to have to redraw and reget the report.  It just has to, zero way around it.  I know that much.  so just putting some code not in postback won't help.  
ASKER CERTIFIED SOLUTION
Avatar of stanscott2
stanscott2

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial