0

My master page has the <!DOCTYPE> and <head> section as follows:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>CMIS</title>
    <link href="~/Site.css" rel="stylesheet" type="text/css" />
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
</head>

In a MyControl.ascx (FieldTemplateUserControl) I have:

<iframe id="Iframe1" runat="server" src="<%# GetNavigateUrl() %>" width="600" height="400">
    <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="<%# GetNavigateUrl() %>" Target="_blank" Text="View" />
</iframe>

The HTML output of above on a rendered page is as follows:

<iframe id="ContentPlaceHolder1_FormView1_ctl04_ctl05___HelpHtml_Iframe1" width="600" height="400" src="/CMIS/Special/OutputHtml.aspx?Table=UserChecklist&Id=67">
    &lt;a id=&quot;ContentPlaceHolder1_FormView1_ctl04_ctl05___HelpHtml_HyperLink2&quot; href=&quot;/CMIS/Special/OutputHtml.aspx?Table=UserChecklist&amp;amp;Id=67&quot; target=&quot;_blank&quot;&gt;View&lt;/a&gt;
</iframe>

Surely the contents of the <iframe> shouldn't be HTML encoded? Is this an ASP.net bug?

How can I stop this from happening?

EDIT: Sorry this is something to do with CsQuery (a DLL which is rendering the HTML)

Chris Cannon
  • 1,157
  • 5
  • 15
  • 36
  • I'm not clear on what you're trying to do. You want to show an IFRAME that loads the page at the URL returned by `GetNavigationURL`. But you also want to have a hyperlink inside the IFRAME? (Which I'm not sure you can do, anyway.) Why? – Ann L. Aug 02 '13 at 16:19
  • post yout GetNavigateUrl() – Bhavin Chauhan Aug 02 '13 at 16:36
  • @AnnL. For browsers which do not support iframes? – Chris Cannon Aug 02 '13 at 18:02
  • @BhavinChauhan I'm on my iPad ATM so can't easily post it, but it doesn't,t do anything special. It just builds and returns a string. – Chris Cannon Aug 02 '13 at 18:08
  • @Chris Cannon I just want to see your code b'cz have you used client id or not if you remove just runat server tag than "ContentPlaceHolder1_FormView1_ctl04_ctl05___HelpHtml_Iframe1" will become as Iframe1 whenever you free just post your code. – Bhavin Chauhan Aug 03 '13 at 05:04

2 Answers2

0

I don't think you can put code inside an IFRAME tag. An IFRAME can't have internal markup. You can only load an IFRAME by setting its src attribute.

Ann L.
  • 13,760
  • 5
  • 35
  • 66
0

Issue being caused by DLL which is rendering the markup instead of normal ASP.NET rendering.

Chris Cannon
  • 1,157
  • 5
  • 15
  • 36