How to use an iframe in mvc

Posted on 2012-08-26
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


    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
    User Beware!  This is a rather permanent solution to removing your email from an exchange server.  The only way to truly go back is to have your exchange administrator restore your mailbox from backups.  This is usually the option of last resort.  A…
    The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
    The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

    746 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now