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 7658377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:11:37+00:00 2026-05-31T13:11:37+00:00

Why does my action method only bind the first word of a string I

  • 0

Why does my action method only bind the first word of a string I pass into it using a query string?

For example, in jquery, I build a queryString from the results of an ajax call:

success: return(resultData){
  var queryString = "?ok=true&message=" + resultData.message;
}

Then I try to load a view into a dialog by calling a controller and passing the queryString

$dialogHandle.load("/Account/RegisterStatus" + queryString, function() { ... });

At this point the queryString correctly hold an entire message. However if I break in my controller:

public ActionResult RegisterStatus(bool ok, string message)
{
        //break here
}

I notice that ok binds correctly but message only contains the first word of the error message passed in.

How can I pass a sentence as one string parameter?
Is there a better way to do this, without query string?

EDIT: hmm now that I think about it does make sense since urls cant have space but then how do I accomplish this… is there a specific word delimiter in the default model binder?

  • 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-31T13:11:38+00:00Added an answer on May 31, 2026 at 1:11 pm

    It’s all about URL escaping: escape("It's me!") // result: It%27s%20me%21

    Do that around your resultData.Message and it should work better. For debugging purposes, use Fiddler2 or some Web Inspector to see what request is being send. This is really valuable when you are debugging AJAX…

    And of course, do the reverse in C#: HttpUtility.UrDecode Method (String)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use the Action<object>.BeginInvoke() method, does this use the thread pool or not? I
I have a problem with Jquery function getJSON, the action url does not trigger
I am using ASP.NET MVC 3. I have an action method called New. When
When a compiler finds a signed / unsigned mismatch, what action does it take?
What does the SQL Action keyword do? Can I use this keyword in a
So I read MSDN and Stack Overflow. I understand what the Action Delegate does
Does anyone know how to implement an action badge, like the ones seen below
DTF does not call the second action if the custom action assembly has more
My view-state to action-state transition does not appear to be happening. In the following
How does one find out which controller or which action they are in from

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.