44
rated 0 times
[
47]
[
3]
/ answers: 1 / hits: 26453
/ 9 Years ago, mon, april 13, 2015, 12:00:00
I want to pass multiple parameters from Url.Action, Here is code in view
window.location.href = @Url.Action(ABC, XYZ, new { @A= ViewBag.A , @B = ViewBag.B });
And this is my Method in Controller XYZ
public ActionResult ABC(string A, string B)
{
// Some Code
}
I always get values in first parameter only and 2nd one is always null. Either if I but B first. 2nd one is always null.
VIEW is basically under JavaScript function.
Here is the URL: http://localhost/CargoMainSite/XYZ/ABC?A=1&B=2
Please note there is some extra text between Parameter one and Parameter two, that is amp; if I explicitly removes it. It works fine and get proper values.
More From » asp.net-mvc