MODIFY RAZOR PARAMS WITHIN JAVASCRIPT

Jayden Bell

Total Post:110

Points:774
Posted by  Jayden Bell
 1074  View(s)
Ratings:
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

  1. Kamlakar Singh

    Post:194

    Points:1396
    Re: Modify Razor params within Javascript

    You can do something like this

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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!