E
Erik
I've found several posts discussing this, but I'm still stumped.
Pasted below is the HTML for a simple aspx file I created in a 1.1
environment. My goal is to give my users a rich text editor, and then
have the HTML submitted to the code behind as a form variable so I can
manipulate it any way I want. The page renders correctly, and the user
can type in the iFrame. And I've determined (via calls to alert())
that setBody() is being called and values are set correctly. But on
the back end I'm consistantly not getting any of the text in the
iframe. I've even written versions that were Netscape friendly, and
had the exact same results.
Any ideas? If I could get this to work it would solve a big problem
for me.
iframeTest.aspx:
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="iFrameTest.aspx.vb" Inherits="iFrameTest"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>iFrameTest</title>
<script>
function setEditor(md) {
// document.editorFrame.document.body.innerHTML = "<b>This is a
test</b> really.";
document.editorFrame.document.designMode=md;
}
function setBody() {
var msgTxt, bdy;
msgTxt = document.editorFrame.document.body.innerHTML;
bdy = document.getElementById("messageBody");
bdy.Value = msgTxt;
return true;
}
</script>
</head>
<body onLoad="setEditor('On');">
<form id="Form1" method="post" onsubmit="return setBody();">
<iframe class="bodyBox" name="editorFrame" id="editorFrame">
</iframe>
<input type="hidden" name="messageBody"/>
<input type="submit">
</form>
</body>
</html>
iframeTest.aspx.vb:
Public Class iFrameTest
Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not Request.Form("messageBody") Is Nothing Then
If Request.Form("messageBody").Length > 0 Then
Response.Write("got a value!")
Else
Response.Write("still nothing")
End If
End If
End Sub
End Class
Pasted below is the HTML for a simple aspx file I created in a 1.1
environment. My goal is to give my users a rich text editor, and then
have the HTML submitted to the code behind as a form variable so I can
manipulate it any way I want. The page renders correctly, and the user
can type in the iFrame. And I've determined (via calls to alert())
that setBody() is being called and values are set correctly. But on
the back end I'm consistantly not getting any of the text in the
iframe. I've even written versions that were Netscape friendly, and
had the exact same results.
Any ideas? If I could get this to work it would solve a big problem
for me.
iframeTest.aspx:
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="iFrameTest.aspx.vb" Inherits="iFrameTest"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>iFrameTest</title>
<script>
function setEditor(md) {
// document.editorFrame.document.body.innerHTML = "<b>This is a
test</b> really.";
document.editorFrame.document.designMode=md;
}
function setBody() {
var msgTxt, bdy;
msgTxt = document.editorFrame.document.body.innerHTML;
bdy = document.getElementById("messageBody");
bdy.Value = msgTxt;
return true;
}
</script>
</head>
<body onLoad="setEditor('On');">
<form id="Form1" method="post" onsubmit="return setBody();">
<iframe class="bodyBox" name="editorFrame" id="editorFrame">
</iframe>
<input type="hidden" name="messageBody"/>
<input type="submit">
</form>
</body>
</html>
iframeTest.aspx.vb:
Public Class iFrameTest
Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Not Request.Form("messageBody") Is Nothing Then
If Request.Form("messageBody").Length > 0 Then
Response.Write("got a value!")
Else
Response.Write("still nothing")
End If
End If
End Sub
End Class