Access Javascript variable in Razor code

前端 未结 2 1453
逝去的感伤
逝去的感伤 2020-12-21 14:34

I want to pass javascript variable in the C# method which is call from the Razor page. May I know how can I do that? (I refer this link but it did not work for me.)

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-21 15:04

    You will need to make an ajax call and resolve the parameter server side, or create a client side equivalent of the function you are using in razor syntax. Look for ajax tutorials if you have no experience with it, i hear jQuery is very good.

提交回复
热议问题