How to use an iframe in mvc

Posted on 2012-08-26
Medium Priority
Last Modified: 2013-11-19
I'm building a web page that produces very wide svg graphics.  Objects on the page must be able to be dragged past the right or left view, scrolling the view left or right as the item is dragged.  In addition, there is a left area and right area that border the main svg graphics area.  So you have a left area, middle area and right area. The graphics are in the middle area.  The graphic objects exceed the right boundary of the center area, and I need to scroll left or right, while the two border areas remain in place.  I think I need an iframe here.  I've never used an iframe in an mvc page and need some help figuring out exactly how to do this.
Does the target of the iframe have to be an html page, or can it be a cshtml view?  Also any other good information on accessing and manipulating this iframe content will be very helpful to me - an example would be great.

I have been able now, to get the iframe to work with mvc.  I basically just create an iframe with an empty source.  Then in some jquery code, I set the source equal to the controller / action that delivers the view.  This works.

However, my problem now is that in this iframe, as the user trys to drag an svg object off the right boundary of the iframe, I need to manually scroll the iframe - so that the dragged svg image is moving right with the scrolling iframes content.  This allows the user to drag from the visible view, into an area of the view that he/she scrolls to right or left.
this is where I am  on this.  I'm not having luck at trying to get this type of manual scrolling to work.  Is there any way to tell the iframe to scroll right when certain events take place?

Question by:jparlato
1 Comment
LVL 29

Accepted Solution

Kumaraswamy R earned 2000 total points
ID: 38428130

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

809 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