473,668 Members | 2,755 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to insert Image at Cursorposition in a RichTextEditor control?

14 New Member
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 3114
acoder
16,027 Recognized Expert Moderator MVP
See this example - <img /> button.
Jan 11 '11 #2
Napsterr
14 New Member
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 New Member
If you are using TinyMCE, they have an inbuilt function:mceIns ertContent
So you can try this-

tinyMCE = parent.tinyMCE;

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

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

Similar topics

5
1349
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
1484
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. -- - Abhishek
0
1458
by: linus | last post by:
Anyone try insert image or binary files to MySQL using ASP.NET? Thanks a lot
2
5508
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 with it and know how to insert an image header to the pdf file? This image is our company logo which we would like it to appear on every
1
12959
by: anuragpj | last post by:
how to insert image in a table in pgsql database.
0
1706
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 like database(no,name,image). I hope u understand this my query....................... 2) Second thing is I want to insert photo image in my database
2
1382
by: shekhar051 | last post by:
how to insert image as a back ground in header row in C#
2
4179
by: yusufjammy | last post by:
How to insert image in mysql database via php and how to retrieve in php ?
2
11352
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 "Package" appears. I want to insert image in that field and load it using ADODC in my Visual Basic form. I have already tried but an error occured in loading Image field of my Access Database. Can anyone solve my problem?? Hope the best answer for you....
1
2036
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 canvas, it became out of bound and I could not see the whole image. So, could you suggest me how to fixed the image on canvas control to be able to see the whole image. And then, the scroll bars of the canvas do not work. I am a new...
0
8381
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8893
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8656
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5681
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4205
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4380
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2791
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2023
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1786
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.