Home > DeveloperSection > Forums > Modify Razor params within Javascript
Jayden Bell
Jayden Bell

Total Post:110

Posted on    December-02-2014 10:27 PM

 ASP.NET MVC JQuery  JavaScript  Razor 

 1 Reply(s)
 1000  View(s)
Rate this:

I am trying to modify parameters routeValue in Razor within Javascript.


function setForm(param) {

   var formCariEntitas = '@Html.Action("FormCariEntitas", "Registrasi", New With {.id = "entitas"'+param+'})';

   return formCariEntitas;


But the error said, "param is not declared. It may be inaccessible". Is there any other way? Is it possible? Thanks

Kamlakar Singh
Kamlakar Singh

Total Post:194

Posted on    December-03-2014 6:52 AM

You can do something like this

   var formCariEntitas ='@Url.Action("FormCariEntitas", "Registrasi")?parameter=' + param;

Don't want to miss updates? Please click the below button!

Follow MindStick