Embed ASPX in MVC view
Embed ASPX in MVC view
Embed ASPX in MVC view
Embed ASPX in MVC view
Embed ASPX in MVC view
Embed ASPX in MVC view Embed ASPX in MVC view Embed ASPX in MVC view Embed ASPX in MVC view Embed ASPX in MVC view Embed ASPX in MVC view Embed ASPX in MVC view Embed ASPX in MVC view
Embed ASPX in MVC view Embed ASPX in MVC view
Embed ASPX in MVC view
Go Back  Xtreme Visual Basic Talk > > > Embed ASPX in MVC view


Reply
 
Thread Tools Display Modes
  #1  
Old 09-12-2011, 07:31 PM
PrOpHeT's Avatar
PrOpHeTEmbed ASPX in MVC view PrOpHeT is offline
Hopelessly confused...

* Expert *
 
Join Date: Mar 2001
Location: Tyler, Tx.
Posts: 3,055
Default Embed ASPX in MVC view


I am just getting my feet wet in MVC, I would like to redesign one of our projects to utilize MVC. The structure of MVC lends itself well to the projects original design and I believe it will make supporting it much easier.

The only major drawback is that I need to be able to use a Microsoft.Reporting.WebForms.ReportViewer to render some RDLC files at one point in the project.

I see no equivalent in the MVC view world without pre-rendering the report and delivering it client side as a PDF or image format, thereby loosing all the report viewer features.

So my plan is to experiment with having the view respond with an iframe, and use the iframe to dynamically encapsulate an ASPX document.

Would this be standard practice for this type of model, bad practice, wrong way of looking at it as a whole?

Other/better suggestions welcome...

I am a complete MVC and Razor novice at the moment and really I am sketching out the broad strokes and gathering ideas.
__________________
When you earnestly believe you can compensate for a lack of skill by doubling your efforts, there's no end to what you can't do ;)

For the love of Gold...
Reply With Quote
  #2  
Old 09-13-2011, 06:28 AM
PlausiblyDamp's Avatar
PlausiblyDampEmbed ASPX in MVC view PlausiblyDamp is offline
Ultimate Contributor

Forum Leader
* Expert *
 
Join Date: Nov 2003
Location: Newport, Wales
Posts: 2,058
Default

Depending on exactly what you are needing to do it might be easiest to just leave the one .aspx page that contains the report viewer as a webform and simply redirect to it from your controller action, not ideal but it will allow you to get the functionality up and running with minimum effort.

If you are going the Razor route for views then this could get difficult if you also need to incorporate a MasterPage / Layout though.
__________________
Intellectuals solve problems; geniuses prevent them.
-- Albert Einstein

Posting Guidelines Forum Rules Use the code tags
Reply With Quote
  #3  
Old 09-13-2011, 07:12 AM
PrOpHeT's Avatar
PrOpHeTEmbed ASPX in MVC view PrOpHeT is offline
Hopelessly confused...

* Expert *
 
Join Date: Mar 2001
Location: Tyler, Tx.
Posts: 3,055
Default

Well the main reason for wanting to render it in the frame is that the razor view is already wrapped in my layout architecture, therefore all of the master style elements apply. The seamless iframe gives the appearance that the aspx page is actually a view and consider it renders in response to the view, it is *somewhat* independent of the rest of the page like the view.

Considering I can dynamically create the frame source in the view, and therefore get the needed params to the ASPX, it all looks like a viable solution...

It would not be the first time I had reinvented a wheel or used the wrong material to build one. So I figured it better to ask before I get too involved in a quagmire.
__________________
When you earnestly believe you can compensate for a lack of skill by doubling your efforts, there's no end to what you can't do ;)

For the love of Gold...
Reply With Quote
  #4  
Old 09-13-2011, 08:37 AM
PrOpHeT's Avatar
PrOpHeTEmbed ASPX in MVC view PrOpHeT is offline
Hopelessly confused...

* Expert *
 
Join Date: Mar 2001
Location: Tyler, Tx.
Posts: 3,055
Default

Just to avoid confusion, here is a simple example of what I am talking about.

For the view that has the need to display the ASPX page...
var content of course being replaced with any number of possible params to pass to the page.

Code:
@{ 
    var rptHeight = ViewBag.rptHeight;
    var content = ViewBag.Content;
   }

<iframe src="../../Pages/ReportView.aspx?content=@content" style="border-style: none; padding: 0px;
    margin: 0px; width: 100%; height: @rptHeight"></iframe>
__________________
When you earnestly believe you can compensate for a lack of skill by doubling your efforts, there's no end to what you can't do ;)

For the love of Gold...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Embed ASPX in MVC view
Embed ASPX in MVC view
Embed ASPX in MVC view Embed ASPX in MVC view
Embed ASPX in MVC view
Embed ASPX in MVC view
Embed ASPX in MVC view Embed ASPX in MVC view Embed ASPX in MVC view Embed ASPX in MVC view Embed ASPX in MVC view Embed ASPX in MVC view Embed ASPX in MVC view
Embed ASPX in MVC view
Embed ASPX in MVC view
 
Embed ASPX in MVC view
Embed ASPX in MVC view
 
-->