Modify Razor params within Javascript

Total Post:110

 1519  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

  1. Post:194

    Re: Modify Razor params within Javascript

    You can do something like this

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


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.