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

  • SEARCH
  • Home
  • 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 6814541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:42:03+00:00 2026-05-26T20:42:03+00:00

I am passing string having special characters in to contollers action in asp.net mvc3.

  • 0

I am passing string having special characters in to contollers action in asp.net mvc3. In action its taking string data as null.

var url = '@Url.Action("SetData", "Home")';
var data = { Text: a, Data: urlData };
               $.post(url, data, function (result) {
                });

Controllers Action:

 public ActionResult SetData(string Text, string Data)
        {
        }

My String data is :

Content Belongs To Tseries and Eros Entertainment Song : Tum Ho Movie : Rockstar Singer : Mohit Chauhan & Suzzane D' Mello Music By : AR Rahman Rockstar is a

How can i pass string having special characters?

  • 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-26T20:42:04+00:00Added an answer on May 26, 2026 at 8:42 pm

    The urlData variable contains HTML encoded entities. You need to HTML decode it first, like this:

    var data = {
        text: 'some text',
        data: $('<div/>').html(urlData).text()
    };
    

    Or maybe change the way you are retrieving the contents of this variable. I think this is where your problem lies essentially.

    or on the server side if you prefer (the first solution is recommended):

    public ActionResult SetData(string text, string data)
    {
        var decodedData = Server.HtmlDecode(data);
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a hard time passing a string constant into an onchange event.
Hi I am having an issue with a MySQL query not passing a string
I am having in issue with IE passing a string back into an swf
I am having a problem passing a json string back to a php script
I am having a function: int getparam(char *gotstring) and i am passing a string
I'm relatively new to C++, and having an issue passing a string. I have
I'm having a problem with Python's string.format() and passing Unicode strings to it. This
I'm having trouble converting a string with escaped characters to and from a TJsonString.
I'm having a problem passing strings that exceed 80 characters in JSON. When I
I'm having trouble passing view information from my Get/Create action to my view. Here

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.