How to pass a razor variable to jquery function as parameter

后端 未结 2 875
清酒与你
清酒与你 2020-12-18 10:38

I am having the following piece of code that is not working:

edit

where I have

相关标签:
2条回答
  • 2020-12-18 10:58

    You need to quote the string like this:

    <a href="#" onclick="Edit('@Interest');">edit</a>
    
    0 讨论(0)
  • 2020-12-18 11:23

    If you want to call a method e.g. @Url.Action("test") for an action link, then you have to use it like:

    <a href='@(Url.Action("test"))'>test</a>
    

    Otherwise korchev's solution is right.

    0 讨论(0)
提交回复
热议问题