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
精彩评论