473,396 Members | 2,020 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,396 software developers and data experts.

How to insert Image at Cursorposition in a RichTextEditor control?

I have a RichTextEditor control. I want to insert image whereever the cursor is. Onclicking Insert link i want to insert Image.
Is it possible?

I have this design in .aspx page.
After clicking on lnkBtnInsert, I want to insert Image which user have uploaded using fileupload control.

Expand|Select|Wrap|Line Numbers
  1. <table border="0" cellpadding="0" cellspacing="0">
  2.         <tr>
  3.             <td>
  4.                  <cc2:Editor ID="Editor1" runat="server" />
  5.             </td>
  6.         </tr>
  7.         <tr>
  8.             <td>
  9.                 <asp:FileUpload runat="server" ID="fileUpload" />
  10.             </td>
  11.             <td>
  12.                 <asp:Button ID="btnUpload" Text="Upload" runat="server" OnClick="btnUpload_Click" />
  13.             </td>
  14.         </tr>
  15.         <tr>
  16.             <td>
  17.                 <asp:Label ID="lblImgPath" runat="server" />
  18.             </td>
  19.         </tr>
  20.         <tr>
  21.             <td>
  22.                 <asp:LinkButton ID="lnkBtnInsert" Text="Insert" runat="server" 
  23.                     onclick="lnkBtnInsert_Click" />
  24.             </td>
  25.         </tr>
  26.     </table>
  27.  
Plz Help me...
Thanx in advance
Jan 6 '11 #1
3 3092
acoder
16,027 Expert Mod 8TB
See this example - <img /> button.
Jan 11 '11 #2
Thank You, acoder

But I can't find solution from this example.
See, I have....
1. Fileupload control using which user uploads image to the server.
2. Rich Text Editor control
I want to insert the uploaded image in the Rich Text Editor control at cursor position.
Jan 12 '11 #3
navdmk
1
If you are using TinyMCE, they have an inbuilt function:mceInsertContent
So you can try this-

tinyMCE = parent.tinyMCE;

function sendToEditor(imgsrc)
{
imgsrc1 = '<div align=\"center\"><img src='+imgsrc+' border="0"></div>';
parent.tinyMCE.execCommand('mceInsertContent', false, imgsrc1);
}
Jan 18 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: MaxH | last post by:
How can I get (and save) the image of a control as a bitmap (or other graphics file format)? Thank you. Max
0
by: Abhishek Bagga | last post by:
I want to insert Image in the column headers of the Listview control I have been trying this but was unable to achieve it. Is it possible? if yes kindly guide me how to achieve this. -- -...
0
by: linus | last post by:
Anyone try insert image or binary files to MySQL using ASP.NET? Thanks a lot
2
by: guoqi zheng | last post by:
dear sir, I am using itextShap for pdf generation. I know I can insert image into it, I can add header to it as well. However, I can not add an image as a header. Does any one has experience...
1
by: anuragpj | last post by:
how to insert image in a table in pgsql database.
0
by: gazanfar | last post by:
Yes thanks Question is that ---I want to insert image/or image path in my SQlServer 2000 through Visual basic application.like after scan of any photo i want insert in database on whoever's no...
2
by: shekhar051 | last post by:
how to insert image as a back ground in header row in C#
2
by: yusufjammy | last post by:
How to insert image in mysql database via php and how to retrieve in php ?
2
by: lwannwayoo | last post by:
Hi Everybody! I have a database in Microsoft Access 2003 and I want to insert image in my Table Field. How can I don it??. I use OLE type but when i insert image to that field only the word...
1
by: Myo Thura Lwin | last post by:
Hello, I am facing one problem with canvas control of Visual Editor on eclipse galileo. I would like to show the image onto canvas in fitted size. But when the image is larger than the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.