This project is read-only.


Topics: General
Dec 7, 2011 at 3:21 AM

How can add an iFrame to a page or is there another way to integrate a custome web app into a page? The app has a aspx extension.

Dec 7, 2011 at 6:37 AM

With an iframe tag?

Jan 20, 2012 at 8:55 PM

Trying to do the same thing in a simple content page. I have the snippet of html saved as a .cshtml file and I can get it working fine in webmatrix. But when I place the iFrame into my Orchard content page (html view) and then close to update, it says 'the resource cannot be found.' I've placed the file in about a half-dozen locations within the Orchard site, but no luck.

This is not a separate application running somewhere else, just a small local file that i'm trying to render along with Orchard html. so, the src= in the iFrame just gives "/snippet" as the file to render in the iFrame.

Jan 20, 2012 at 9:29 PM

Trying to display a cshtml from an iframe won't work; an iframe loads a html file, and the web server will refuse to serve a cshtml file statically, as it should.

But if you put the cshtml file into /Views, you can just include it with: @Display.Foo() - where Foo is the name of your template.

Jan 20, 2012 at 9:34 PM

I tried changing the extension and giving it a full path URL.

But I will follow your advice here. Just tell me where am I using the razor code you mention above. What specific View in the theme I'm using (contoso) would I put this into?

I was pretty sure you did not mean to put @Display.Foo() directly into the content html for the page.

Jan 20, 2012 at 10:21 PM

Which folder did you put it in? Orchard's folders are locked down so you can only serve static files out of the correct ones, in this case you'd use Content for a html file.

Use the code in the .cshtml where you were putting the iframe?