how to send TextEditor text to Generic handler

Posted on 2014-08-26
Last Modified: 2014-08-28
I am using one text editor on my web form

and I am trying to write the code to save the text editor value/html in database by calling a Jquery Ajax method and I am calling a generic handler to save the values.

Now it works fine if I only type simple  text in the editor but as soon as I enter or apply any styling and try to save it, I gets this error " A potentially dangerous Request.Form value was detected from the client ".

How can I save the html of editor field in my database?
Question by:yadavdep
    LVL 58

    Expert Comment

    It's because you probably have < > in the post value

    To the page directive add

    If .net 4 then you will also need to add to your web.config in the httpRuntime section
    <httpRuntime requestValidationMode="2.0"/>
    LVL 11

    Accepted Solution

    Operating blind (post your code so that we have something to work from (please!)) you can use the JavaScript function escape()
    var newString = escape( oldString );

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
    In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now