Solved

ASP.NET 2.0 Control Javascript IFRAME

Posted on 2007-03-19
7
1,831 Views
Last Modified: 2012-06-21
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.
0
Comment
Question by:cophi
  • 3
  • 3
7 Comments
 
LVL 63

Expert Comment

by:Zvonko
ID: 18748574
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 :(

0
 
LVL 15

Expert Comment

by:stanscott2
ID: 18748617
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.
0
 

Author Comment

by:cophi
ID: 18750927
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?
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:cophi
ID: 18751097
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
0
 
LVL 15

Expert Comment

by:stanscott2
ID: 18751237
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.
0
 

Author Comment

by:cophi
ID: 18751263
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.  
0
 
LVL 15

Accepted Solution

by:
stanscott2 earned 500 total points
ID: 18752329
But, if you know that a postback is necessary, and you know that the report viewer is going to redo the report, what's the question?  There will inevitably be flicker, whether you put the report into an iframe or not.  That's the nature of .NET -- postbacks == reloads.

The Ajax approach is to make a back-end request and replace the current HTML inside a DIV or SPAN with something new.  If you want to address this, explore Microsoft AJAX, but this will take a good bit of rewriting.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

770 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