loviji
loviji

Reputation: 13080

button click calling a MVC Action Method with parameters

I want to call MVC actions with parameters

location.href = '<%: Url.Action("mAction", "mControl", "new {IDs='+selectedIDs+'}) %>'; 

or location.href = '<%: Url.Action("mAction", "mControl", "new {IDs=123}) %>';

I get error:

CS1010: Newline in constant

How to fix it?

Upvotes: 0

Views: 3946

Answers (1)

Rapha&#235;l Althaus
Rapha&#235;l Althaus

Reputation: 60493

strange quotes before new

can you try

location.href = '<%: Url.Action("mAction", "mControl", new {IDs=123}) %>';

Upvotes: 4

Related Questions