How to access JS variable in C#

前端 未结 5 1358
轻奢々
轻奢々 2021-01-15 19:33

Let\'s say I have

500

(Context: asp.net aspx page) How do I allow a c# code access that value?

<
5条回答
  •  不知归路
    2021-01-15 20:17

    You can use a server-side div instead, like i.e;

    500
    

    Then you can access it and its contents server-side.

    Alternatively;

    UPDATE: After the question was clarified, it is clear this won't work. The only solution then is to use javascript to get the value, then AJAX to send it to the server.

提交回复
热议问题