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

前端 未结 5 2003
别那么骄傲
别那么骄傲 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:49

    If you are wanting to keep the variable hidden then you could use a session to store your object.

    E.g.,

    Setting the session value

    Session["HiddenValue"] = "something";
    

    Getting the session value

    string something =  (string)Session["HiddenValue"];
    

    Do keep in mind however, that sessions are only for a limited time (this can be configured thorugh IIS and your web configuration).

    Here is a good resource to learn about sessions and session state.

提交回复
热议问题