473,412 Members | 3,015 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

retrieve data from IFrame textbox

Hi all

i'm having a little problem
I have a aspx file with a iFrame defined
The iframe is loaded with a html webeditor
After editing data in the webeditor textbox, i want t
get the data to a hidden field in the aspx file
What is the best way todo this
Is it possible to add some sample code because a i have tried a lo
but nothing works

mypage.aspx(html source
-----------------------------

<iframe id="iFrameAbstractBody" style="Z-INDEX: 103; LEFT: 24px; WIDTH: 800px; POSITION: absolute; TOP: 112px; HEIGHT: 680px
src="../Editor/htmlEditor/hostHtmlEditor.HTML" frameBorder="no" width="800" height="700"></iframe
here i have the iframe added!
mypage.aspx(vb source
---------------------------
Private Sub cmdContinue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdContinue.Clic
cmdContinue.Attributes.Add("onClick",
"document.Form1.txtgetDataFromIFrameElement.va lue = iFrameAbstractBody.document.editarea.innerHTML;"
End Su

Here i have a button that should bring the data to de aspx hidden field
Whats wrong here
Or am i wrong

Thanxs in advance
Nov 18 '05 #1
1 4867
I hope this helps... If you are actually going to post the data in the from
then you will need to add the validationRequest="false" otherwise you will
get the unsafe code error.

-Brian K. Williams

***** ASPX *****
<%@ Page language="c#" validateRequest="false" Codebehind="HTMLEdit.aspx.cs"
AutoEventWireup="false" Inherits="TestApp.HTMLEdit" %>
<HTML>
<HEAD>
<title></title>
<meta stuf....
</HEAD>
<body...
<form id="Form1" method="post" runat="server">
<iframe id="iFrameAbstractBody" style="Z-INDEX: 101; LEFT: 24px; WIDTH:
800px; POSITION: absolute; TOP: 112px; HEIGHT: 680px"
src="HTMLEditor.htm" frameBorder="no" width="800" height="700"></iframe>
<asp:TextBox id="txbHTML" style="Z-INDEX: 102; LEFT: 32px; POSITION:
absolute; TOP: 16px" runat="server"
Width="592px" Height="56px"></asp:TextBox>
</form>
</body>
</HTML>
***** HTML With Web Editor *****
<html>
<head>
<title></title>
<meta stuf...
<script>
function submitHTML()
{
parent.document.all.item("txbHTML").value =
document.all.item("divHTMLArea").innerHTML;
}
</script>
</head>
<body>
<div id="divHTMLArea">
This is <b>some</b> text...
</div>
<label id=lblSubmit onclick=submitHTML()>Submit</label>
</body>
</html>

"Jan Van Steenbergen" <an*******@discussions.microsoft.com> wrote in message
news:B2**********************************@microsof t.com...
Hi all,

i'm having a little problem.
I have a aspx file with a iFrame defined!
The iframe is loaded with a html webeditor.
After editing data in the webeditor textbox, i want to
get the data to a hidden field in the aspx file.
What is the best way todo this?
Is it possible to add some sample code because a i have tried a lot
but nothing works?

mypage.aspx(html source)
------------------------------

<iframe id="iFrameAbstractBody" style="Z-INDEX: 103; LEFT: 24px; WIDTH: 800px; POSITION: absolute; TOP: 112px; HEIGHT: 680px" src="../Editor/htmlEditor/hostHtmlEditor.HTML" frameBorder="no" width="800" height="700"></iframe> here i have the iframe added!!
mypage.aspx(vb source)
----------------------------
Private Sub cmdContinue_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdContinue.Click cmdContinue.Attributes.Add("onClick", _
"document.Form1.txtgetDataFromIFrameElement.va lue = iFrameAbstractBody.document.editarea.innerHTML;") End Sub

Here i have a button that should bring the data to de aspx hidden field!
Whats wrong here?
Or am i wrong?
Thanxs in advance!

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Richard St?en | last post by:
Hi! We are experiencing a problem with running an .aspx page inside an iframe. The .aspx page is loading perfectly the first time (on load), but when we try to interact/navigate within the .aspx...
1
by: Jan Van Steenbergen | last post by:
Hi all i'm having a little problem I have a aspx file with a iFrame defined The iframe is loaded with a html webeditor After editing data in the webeditor textbox, i want t get the data to a...
0
by: Edge | last post by:
I have two aspx pages. First one, page1.aspx, has an iframe inside. Src attribute of this iframe is pointing to the second page, page2.aspx. In page2.aspx I have a textbox and a dropdownlist....
0
by: Raju | last post by:
Hi all i am Rajendran I am working as a asp.net programmer. I am frish to this field so please any of u garify my doubt I Create array of Textbox Dynamically and not passible to retrieve data...
0
by: DBxGlock | last post by:
Howdy folks, I have an asp.net webpage that has a table with 2 columns. In the left column is an IFrame. In the right column is a bunch of user controls including a textbox, some buttons, a...
1
by: vHTML | last post by:
hello everyone :) I am trying to make a page which would take a "entered" on search query from the previous page and display results in google with that query in an <iframe> in the results.htm...
9
by: Mel | last post by:
I have 10 columns total. 3 of them are invisible. The rest are read- only BoundFields, 3 of which are editable fields using TemplateFields. Upon editing, I want to validate what the user enters...
2
by: durga2005 | last post by:
Hi I m using webgrid control I m trying to add a new record using its footer In the footer I placed a button,and one textboxe to insert the new record. when I click the add button,the data in...
2
by: phpachu | last post by:
Hi, I hav created a group of textboxes using a loop and its names are unique and names are assigned using variable ( like <input type=text name=$name1>). Then How can i retrieve the values in...
2
by: Manikrag | last post by:
Hi again I am using an AutoCompleteExtender in a user control alone with a textbox and button...On selection from auto selection dropdown or on button click event I am taking the control to next...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.