?
Solved

ASP.NET 2.0 Control Javascript IFRAME

Posted on 2007-03-19
7
Medium Priority
?
1,847 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

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 2000 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…
Suggested Courses

777 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