开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜