Is it possible to set localStorage or Session variable in asp.net page and read it in javascript on the other page?

后端 未结 5 1335
囚心锁ツ
囚心锁ツ 2020-12-19 07:45

As in question. Is it possible to set variable in asp.net page in localStorage and retrieve it on the other page?

How to set localStorage variable in asp.net. Is it

5条回答
  •  自闭症患者
    2020-12-19 08:27

    I think setting session variable in page & read variable in javascript of another page is possible. But, if you are looking out for localstorage that won't be. It needs javascript. For session variable e.g.
    A.aspx

    <% Session["username"]="Donald Duck"; %>

    B.aspx

    >  
    

提交回复
热议问题