开发者

How to open a window using javascript being fired from one view without showing paramter in url in MVC

开发者 https://www.devze.com 2023-04-13 04:30 出处:网络
I have one button on a view and on click of it, I m trying to open a new page. I have some collection that I want it on the next page. Witho开发者_StackOverflow中文版ut passing the collection of strin

I have one button on a view and on click of it, I m trying to open a new page. I have some collection that I want it on the next page. Witho开发者_StackOverflow中文版ut passing the collection of string through url, can it be possible ?


In Asp.NET you can use the viewstate as a context manager, but Warning : do not write criticlal data into the viewstate, it's content is easily readable with some tools.

In PHP, you could use session variables to deal with it.


You can use a session var

In the first page

protected yourvartype yourvar
    {
        get
        {
            var info = (yourvartype )Session["namevar"];

            return info;
        }
        set
        {
            Session["namevar"] = value;
        }
    }

asign data :

yourvar = DATA

in the second page

protected yourvartype yourvar
    {
        get
        {
            var info = (yourvartype )Session["namevar"];

            return info;
        }
    }

Use: Newvar = yourvar

but but be careful to send lots of information on the variable and exaggerate the use of session variables because they use server resources

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号