简体   繁体   中英

Displaying html page in ASPX page

I need to display dynamic created html in aspx(server side html); I tried to use Iframe but it will not displaying anything ; it will not work because of security reasons ; Is there is any controls that will display html page? Dynamic html have its on css and javascripts so I can't use html text box controls. If anyone have solution please help Thanks

Since your dynamic page has its own CSS & Javascript, I'm assuming it's not written to coexist with its host page. I'm also assuming that when you tried to use the iFrame you just tried to write straight to it from the containing page.

I would suggest moving your code that generates the HTML to a separate ASPX page and referencing that page as the source of your iFrame or rewriting your CSS & Javascript so it will coexist and using a DIV.

Also, it's sort of hard to come up with a workable solution without you showing some of the code you have currently.

Have a look at the

<asp:Literal>

control. There's an example here: Set ASP Literal text with Javascript

-- EDITED 03/05/2012 --

Simple example of an asp.net literal control in action:

.aspx code

<asp:Literal ID="MyLiteral" runat="server" />

.vb code behind

Dim k As String
k = "<table style=""border: 1px solid red;""><tr><td>Cell 1</td></tr><tr><td>Cell 2</td></tr></table>"
MyLiteral.Text = k

If I compile this in VS2008 I get a two row table with a red border in IE.

I found the answer!! Use UFRAME!! It's simple and easy!! uframe.codeplex.com

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM