How to pass a hidden field from one page to another?

前端 未结 5 2006
别那么骄傲
别那么骄傲 2021-01-28 01:23

I have a .Net class library. I want to pass a hidden variable from once code behind page and fetch it in another code behind page. PLease note I dont have any design page(aspx p

5条回答
  •  终归单人心
    2021-01-28 01:41

    you can save the value in the Session as such:

    Session["YourName"] = yourvalue;
    

    in code behind you do this:

    Session["MyValue"] = "theValueYouWantToPass";
    

    in your other page you do:

    string valueFromAnotherPage = Session["MyValue"].ToString();
    

提交回复
热议问题