I have this code in the controller
public ActionResult Close(string cName)
{
return RedirectToAction("action1", "Home",
new { IdsName = cName });
}
but the url that is being created has %20 (space), it is being created like this
http://localhost:xxxx/Home/action1.mvc?IdsName = xyz%20%20asd
but I want the url to be this way
http://localhost:xxxx/Home/action1.mvc?IdsName = xyz asd
I want a space and not %20. How can I achieve this ?
Thank you
%20 is the url encoded space character. Space characters are not valid characters in the uri, so the MVC framework encodes the value for you.
When your Home/Action1 method is called the value will have been url decoded (by the MVC framework) to contain the space character once more.