开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜