Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7517399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:26:18+00:00 2026-05-30T01:26:18+00:00

I have a client/server application (asp.net), which has a textarea which a user types

  • 0

I have a client/server application (asp.net), which has a textarea which a user types in html elements+text.

the data being sent from client to server is via jQuery ajax POST. ( to ashx)

lets say the client type in:

<b> Hello </b> 

so I :

1) encodeUriComponent the whole text.

2) Html Encode Special Chars ( like &gt; &lt;)

3) send this to the server

4) save in DB.

Question :

what is the prefered way of saving in db ?

With &gt; &lt;? or should I decode it and then save it?

(data should be presented to user, some time in the future…)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:26:20+00:00Added an answer on May 30, 2026 at 1:26 am
    1. POST the raw HTML input to your desired action
    2. Use the [AllowHtml] attribute on the desired field of your model.
    3. Use Microsoft’s Anti-XSS library to remove any javascript, etc (unless that’s intended).
    4. Save raw HTML to your database, but be sure to use parameterized queries to prevent injection attacks.
    5. Stop HTML Encoding everything. It looks terrible.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a client server application in which I need to transmit a user
I have an ASP.Net web application, which interacts with .Net Remoting application server. As
I have a asp.net web application which has a number of versions deployed on
We have a client/server application with a rich client front end (in .Net) and
I have a client/server application that communicates with .Net remoting. I need my clients
I have a client-server application that uses .net remoting. The clients are in a
I have a client server application in which the server and the client need
I have an ASP.NET 2.0 application under IIS that has the functionnality of exporting
I want to create an application which will have a client and server components.
I have created an ASP.NET Webforms web application which basically inetracts with the code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.