Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ASP.NET 2.0 Control Javascript IFRAME

Posted on 2007-03-19
7
Medium Priority
?
1,853 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article discusses how to implement server side field validation and display customized error messages to the client.
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
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

636 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