Forum Moderators: open

Message Too Old, No Replies

IFRAME - External Site

         

ang_bain

11:33 am on Jun 25, 2010 (gmt 0)

10+ Year Member



Hi...i've got an asp.net page that is posting to an asp site..ok so far.. my prob is i want the returned page to sit in an iframe..i can get it in a target = _blank but not in the iframe...any ideas...

thanks

marcel

11:49 am on Jun 25, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can set target to the name of your Frame, ie:
target="iFrameName"


<frame name="iFrameName" src="/MayTargetPage.html">

ang_bain

11:56 am on Jun 25, 2010 (gmt 0)

10+ Year Member



Hi Marcel i've tried that with the form in the javascript that posts the page

document.frmMain.setAttribute("target", "frame1");

I can't put it directly into the frame src as i need to post to it...unless you know different...is it poss to do this...

marcel

12:18 pm on Jun 25, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you tried setting the Form target in page behind?

form1.Target = "frame1"

ang_bain

12:32 pm on Jun 25, 2010 (gmt 0)

10+ Year Member



can't do that marcel as the form is being created within xslt and submited with javascript...I just tried putting it in the form tag like below but didn't work...i still get the popup and if i view source i've got a thread aborted message...

<xsl:template match="test">
<!--Start of Javascript -->
<script language="JavaScript" type="text/javascript">
<![CDATA[
function submitform() {
document.frmMain.setAttribute("target", "frame1");
document.frmMain.submit();

}
]]>
</script>
<!-- End of Javascript -->

<html>
<body onload="submitform()" style='display:none'>
<form id="frmMain" name="frmMain" target="frame1" action="http://www.test.asp" method="POST">
<input type="text">
<xsl:attribute name="id">criteria</xsl:attribute>
<xsl:attribute name="name">test</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="//test" />
</xsl:attribute>
</input>

</form>
</body>
</html>
</xsl:template>

ang_bain

12:34 pm on Jun 25, 2010 (gmt 0)

10+ Year Member



the <xsl:attribute name="id">criteria</xsl:attribute> should be <xsl:attribute name="id">test</xsl:attribute> sorry my typo