ASP.NET MVC 2 - How do I pass a querystring back on response?
I need to pass a que开发者_如何学Crystring back on response - so that via means of jQuery I can do something with it.
something like this: return RedirectToAction("LogOn", "Account", new { id = "?action=update" });
URL needs to end up like: ../Account/LogOn/?action=update
but the above code produces this instead: ../Account/LogOn/%3faction%3dupdate
I don't want the encoding...
Help?
I think, in this case, you should use
return RedirectToAction("About", "Home", new { sendto = "update" });
You can't use the keyword "action" because it will be consumed by mvc, so I've replaced it with "sendto" instead.
In your controller, name the parameter with the @ sign, as Pawel writes. So
public ActionResult YourAction(string @action) will work
public ActionResult YourAction(string action) will fail
精彩评论