VB.NET and Web Forms

Hi All.
I Have one problem
On web form,i have one link thats open when you click.
When its open,You have a text Area.
I must to insert text from my richtextbox into that textarea.
The code of that textArea is:
<body id="tinymce" class="mceContentBody " spellcheck="false" dir="ltr"><p><br mce_bogus="1"></p></body>

Open in new window

I tried to use this code:
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        Try
            WebBrowser1.Document.GetElementById("tinymce").InnerText = RichTextBox1.Text
        Catch ex As Exception
        End Try

Open in new window

But it doesnt Work.
I HAVE VB.NET
Thank You
Sorry For My English,I'm Russian
Replica178Asked:
Who is Participating?
 
honestman31Commented:
try this plz
WebBrowser1.Document.Window.DomWindow.execscript("tinyMCE.activeEditor.setContent(RichTextBox1.Text);", "JavaScript")

Open in new window

0
 
honestman31Commented:
try this
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        Try
            WebBrowser1.Document.All.Item("tinymce").Value = RichTextBox1.Text
        Catch ex As Exception
        End Try

Open in new window

0
 
Replica178Author Commented:
Doesn't work
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
honestman31Commented:
I think you are using tinymce  which not A text area as you mentioned ,
Can you please attach ( or post a link to  the URL ) that has the tinymce
0
 
honestman31Commented:
try those please




Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        Try
            WebBrowser1.Document.All.Item("tinymce").outerhtml = RichTextBox1.Text
        Catch ex As Exception
        End Try


And this one too


Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        Try
            WebBrowser1.Document.All.Item("tinymce").innerhtml = RichTextBox1.Text
        Catch ex As Exception
        End Try
0
 
Replica178Author Commented:
Doesn't Work (
0
 
honestman31Commented:
this should work :)
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        Try
          Call WebBrowser1.Document.parentWindow.execScript("tinyMCE.activeEditor.setContent(RichTextBox1.Text);", "JavaScript")
        Catch ex As Exception
        End Try

Open in new window

0
 
Replica178Author Commented:
This is for VB 6.0,but i have VB.NET
0
 
honestman31Commented:
Well , I still use VB6  so I think the problem is the CALL
so I suggest u replace CALL with t=
Make sure T is declared
Like this  



t= WebBrowser1.Document.parentWindow.execScript("tinyMCE.activeEditor.setContent(RichTextBox1.Text);", "JavaScript")

Open in new window

0
 
Replica178Author Commented:
the problem is parentWindow
0
 
Replica178Author Commented:
error 80020101
0
 
honestman31Commented:
Well , I have to install VB.net to check on that , will get back to u tomorrow then
0
 
Replica178Author Commented:
ok.thank you
0
 
CodeCruiserCommented:
Are you trying to show text in a control that is a different page?
0
 
Replica178Author Commented:
yes.I tried.Its not differrent
0
 
CodeCruiserCommented:
>yes.I tried.Its not differrent

Now "yes" means that its separate pages but then you contradict yourself by saying "its not different".

If you want to copy text to a text area on a page from a richtextbox on a different page, you may have to use session (query string is an option but I am assuming that text would be long so its not suitable).
0
 
Replica178Author Commented:
i tried this
 
WebBrowser1.Document.Window.DomWindow.execscript("tinyMCE.activeEditor.setContent('<span>Richtextbox1.Text</span>')", "JavaScript")

Open in new window

Its Perfectly Work,But it Write Richtextbox1.Text,but i need the Richtextbox1.Text value
0
 
CodeCruiserCommented:
>But it Write Richtextbox1.Text,but i need the Richtextbox1.Text value

It writes Richtextbox1.Text but you want the Richtextbox1.Text??? Your English is not that weak is it?
0
 
Replica178Author Commented:
I'M RUSSIAN!
In textArea it WRITE "RICHTEXTBOX1.TEXT" - IT's A TEXT
I NEED TO WRITE THE RICHTEXTBOX1.TEXT VALUE!!!!!!!

0
 
CodeCruiserCommented:
As I said, if the richtextbox and the textarea are on two separate pages, try using the session.

Or are both controls on same page?
0
 
Replica178Author Commented:
WebBrowser1.Document.Window.DomWindow.execscript("tinyMCE.activeEditor.setContent('<span>" + RichTextBox1.Text + "</span>')", "JavaScript")

Open in new window

IT's WORK .
honestman31 THANK YOU!
0
 
Replica178Author Commented:
THANK YOU
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.