I am doing the following. However whenever the text in the IFRame (ifrHTML)
has any type of formatting other than plaintext, the innerHTML is not
returned.
If I do a CTRL+B (bold) or CTRL+U (Underline) or any other formatting. The
cmdSend_Click routine is not entered. That is what puzzles me.
~~~~~~~~~~~~
WEBFORM
~~~~~~~~~~~~
<HTML>
<body>
<form id=frmMain method=post runat="server">
<iframe id=ifrHTML name=ifrHTML ></iframe>
<asp:Button id=cmdSend runat="server" Text="Send"></asp:Button>
<input type=hidden name=hidValue>
</form>
<script>
//Set the IFRame to Design Mode.
ifrHTML.document.designMode="on"
</script>
</body>
</HTML>
~~~~~~~~~~~~
CODE BEHIND.
~~~~~~~~~~~~
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
cmdSend.Attributes.Add("onClick",
"document.frmMain.hidValue.value = ifrHTML.document.body.innerHTML;")
End Sub
Private Sub cmdSend_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles cmdSend.Click
Try
Dim strValue As String
strValue = Request.Form("hidValue")
Catch ex As Exception
Throw New Exception(ex.ToString())
End Try
End Sub
L Anthony Johnson
"Alex Papadimoulis" <alexp-at-halogenstudios.com> wrote in message
news:uN*************@tk2msftngp13.phx.gbl...
This information is not sent back to the server. You would have to use
Javascript to place an IFrame's InnerHTML in an HTML Hidden Input tag and
read it that way.
Alex Papadimoulis
"L Anthony Johnson" <pp*****@nospamm4m3bellsouth.net> wrote in message
news:uA**************@tk2msftngp13.phx.gbl... Has anyone had any success doing this. I have tried, but the InnerHTML
property always comes back as an empty string.
L Anthony Johnson