Insert a hyperlink
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngrichtextbox' list.


evd@fennum.com
Hi all,

This is our situation:
We have created a separate button in a layer over the RichTextBox control.
We want to use this button instead of the default "insert image" button that
comes with RTB.
This new button must insert a hyperlink at the cursor position within the
RichTextBox. Link to be inserted looks like <img
src="getimage.aspx?imgID=123">. I hope somebody has already dealt with
something like this and can give as an example of how to solve this.

TIA,
@win van Duijn,
The Netherlands.
Reply to this message...
 
    
Ollie Cornes
I'll use a form button as an example. Imagine this is the button you
click to insert the image:
<input type="button" value="insert image"
onclick="insertImage('getimage.aspx?id=45')" />

You can add the client-script function to insert the image like this:

<script language="javascript">
function insertImage(img)
{
richtext1_x5.focus();
richtext1_x5.document.execCommand('InsertImage','',img);
}
</script>

NOTE: You must change the "richtext1" at the start of the two lines in
the function with the identifier of your RichTextBox. So, for example,
if your RichTextBox is called MyEditor, the first line would change to
MyEditor_x5.focus();

Please be aware that working with script in this way is not what this
version was designed for. I think that was a mistake and one that will
be rectified across future releases. I mention because there is a
possibility that in order to achieve a better product in future the
iframe (the _x5) may be renamed and so when new versions come along,
please do test any existing client code against it on a staging server.
The release notes for new releases will include details of changes and
so hopefully the transition will be easy.

Does this answer your question?

Ollie
--
http://www.richtextbox.com/

-----Original Message-----
From: Click here to reveal e-mail address
[mailto:Click here to reveal e-mail address] On Behalf Of
Click here to reveal e-mail address
Sent: 18 June 2002 09:17
To: aspngrichtextbox
Subject: [aspngrichtextbox] Insert a hyperlink

Hi all,
This is our situation:
We have created a separate button in a layer over the RichTextBox
control. We want to use this button instead of the default "insert
image" button that comes with RTB.
This new button must insert a hyperlink at the cursor position within
the RichTextBox. Link to be inserted looks like <img
src="getimage.aspx?imgID=123">. I hope somebody has already dealt with
something like this and can give as an example of how to solve this.
TIA,
@win van Duijn,
The Netherlands.
| [aspngrichtextbox] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/aspngrichtextbox.asp = JOIN/QUIT
Reply to this message...
 
    
Kevin White
Hi there,

This is interesting since I'm looking at ways to insert images. I kind of
did a similar thing previously with a normal textarea using focus caret (or
something like that!). A popup window was then used to squirt in some html
of theimage url at the cursor in the textarea.

Kevin.

=======================================================================designMe Ltd.

Birmingham
Telephone: 0121 693 5778
Facsimile: 0121 693 5779

York
Telephone: 01904 466643
Facsimile: 01904 610718
=======================================================================
This message may contain confidential information and is intended only for
the individual named.
If you are not the named addressee you should not disseminate, distribute or
copy this e-mail.
Please notify designMe immediately by return e-mail if you have received
this e-mail by mistake
please delete it from your system. E-mail transmission cannot be guaranteed
to be secure or
error-free as information could be intercepted, corrupted, lost, arrive
late, be incomplete or contain
viruses. The sender therefore does not accept liability for any errors or
omissions in the contents
of this message which may arise as a result of e-mail transmission.

-----Original Message-----
From: Ollie Cornes [mailto:Click here to reveal e-mail address]
Sent: 18 June 2002 10:38
To: aspngrichtextbox
Cc: Click here to reveal e-mail address
Subject: [aspngrichtextbox] RE: Insert a hyperlink

I'll use a form button as an example. Imagine this is the button you click
to insert the image:
<input type="button" value="insert image"
onclick="insertImage('getimage.aspx?id=45')" />

You can add the client-script function to insert the image like this:

<script language="javascript">
function insertImage(img)
{
richtext1_x5.focus();
richtext1_x5.document.execCommand('InsertImage','',img);
}
</script>

NOTE: You must change the "richtext1" at the start of the two lines in the
function with the identifier of your RichTextBox. So, for example, if your
RichTextBox is called MyEditor, the first line would change to
MyEditor_x5.focus();

Please be aware that working with script in this way is not what this
version was designed for. I think that was a mistake and one that will be
rectified across future releases. I mention because there is a possibility
that in order to achieve a better product in future the iframe (the _x5) may
be renamed and so when new versions come along, please do test any existing
client code against it on a staging server. The release notes for new
releases will include details of changes and so hopefully the transition
will be easy.

Does this answer your question?

Ollie
--
http://www.richtextbox.com/

-----Original Message-----
From: Click here to reveal e-mail address
[mailto:Click here to reveal e-mail address] On Behalf Of
Click here to reveal e-mail address
Sent: 18 June 2002 09:17
To: aspngrichtextbox
Subject: [aspngrichtextbox] Insert a hyperlink

Hi all,
This is our situation:
We have created a separate button in a layer over the RichTextBox control.
We want to use this button instead of the default "insert image" button that
comes with RTB.
This new button must insert a hyperlink at the cursor position within the
RichTextBox. Link to be inserted looks like <img
src="getimage.aspx?imgID=123">. I hope somebody has already dealt with
something like this and can give as an example of how to solve this.
TIA,
@win van Duijn,
The Netherlands.
| [aspngrichtextbox] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/aspngrichtextbox.asp = JOIN/QUIT
| [aspngrichtextbox] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/aspngrichtextbox.asp = JOIN/QUIT
Reply to this message...
 
    
evd@fennum.com
We got things working okay now. Thanks for the quick reply....
Kind regards,
@win.
-----Original Message-----
From: Ollie Cornes [mailto:Click here to reveal e-mail address]
Sent: dinsdag 18 juni 2002 11:38
To: aspngrichtextbox
Cc: Duyn van, Edwin
Subject: [aspngrichtextbox] RE: Insert a hyperlink

I'll use a form button as an example. Imagine this is the button you click
to insert the image:
<input type="button" value="insert image"
onclick="insertImage('getimage.aspx?id=45')" />

You can add the client-script function to insert the image like this:

<script language="javascript">
function insertImage(img)
{
richtext1_x5.focus();
richtext1_x5.document.execCommand('InsertImage','',img);
}
</script>

NOTE: You must change the "richtext1" at the start of the two lines in the
function with the identifier of your RichTextBox. So, for example, if your
RichTextBox is called MyEditor, the first line would change to
MyEditor_x5.focus();

Please be aware that working with script in this way is not what this
version was designed for. I think that was a mistake and one that will be
rectified across future releases. I mention because there is a possibility
that in order to achieve a better product in future the iframe (the _x5) may
be renamed and so when new versions come along, please do test any existing
client code against it on a staging server. The release notes for new
releases will include details of changes and so hopefully the transition
will be easy.

Does this answer your question?

Ollie
--
http://www.richtextbox.com/

-----Original Message-----
From: Click here to reveal e-mail address
[mailto:Click here to reveal e-mail address] On Behalf Of
Click here to reveal e-mail address
Sent: 18 June 2002 09:17
To: aspngrichtextbox
Subject: [aspngrichtextbox] Insert a hyperlink

Hi all,
This is our situation:
We have created a separate button in a layer over the RichTextBox control.
We want to use this button instead of the default "insert image" button that
comes with RTB.
This new button must insert a hyperlink at the cursor position within the
RichTextBox. Link to be inserted looks like <img
src="getimage.aspx?imgID=123">. I hope somebody has already dealt with
something like this and can give as an example of how to solve this.
TIA,
@win van Duijn,
The Netherlands.
| [aspngrichtextbox] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/aspngrichtextbox.asp = JOIN/QUIT
| [aspngrichtextbox] member Click here to reveal e-mail address = YOUR ID |
http://www.aspfriends.com/aspfriends/aspngrichtextbox.asp = JOIN/QUIT
Reply to this message...
 
 
System.Windows.Forms.RichTextBox




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com