How to add image at mouse cursor position in a user form RRS feed

  • Question

  • User355846639 posted


    I am beginner in asp.net core 2.2 using razor pages.

    I'd like to know how can i create a form where user can write a text then add image at cursor position then he can continue to write his text and add another image.

    It is something like in writing and add image in a word document.

    Thanks in advance for any help or suggestion.

    Tuesday, September 17, 2019 4:28 PM

All replies

  • User753101303 posted


    The basic idea is to use https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Editable_content which allows to allow editing a part of an HTML page. You'll find many "rich text editors" using this as the basis to create https://en.wikipedia.org/wiki/Online_rich-text_editor which list some of the most popular options.

    This particular point is basically unrelated to what you are using on the server side.

    Tuesday, September 17, 2019 5:12 PM
  • User-474980206 posted
    What you are asking can only be written in JavaScript. It would also require advanced browser dom understanding, and advanced JavaScript. As suggested you would be better off you an existing JavaScript based editor.

    Note: after picking the library, for image support, you will need to write server code based on the libraries requirements.
    Wednesday, September 18, 2019 12:55 AM
  • User355846639 posted

    Thank you PatriceSC for your reply i'll see the links and i'll try to achieve this. Thank you again !

    Wednesday, September 18, 2019 1:22 AM
  • User355846639 posted

    Thank you Bruce, any suggestion for me is welcome and i'll take your suggestion in consideration. Thank you !

    Wednesday, September 18, 2019 1:24 AM