rook ....
rook ....

Reputation: 156

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

Upvotes: 0

Views: 3621

Answers (3)

rook ....
rook ....

Reputation: 156

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

Upvotes: 0

markp3rry
markp3rry

Reputation: 734

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.

Upvotes: 0

user1921
user1921

Reputation:

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.

Upvotes: 1

Related Questions