Interesting...
But I have seen a few examples of this nature in the internet.
This is where i got the idea from the first place.
What do you meen than by 'passing variables between modules'?
If these are code modules i can pass variables to them without the context
object at all..
What is your preffered method to passing variables between web forms?
Are there reasons not to do it with the good old session object?
I know one can use Server.Transfer("nextWebForm.aspx",true) to pass one
the request.querystring from current form to the next one, but have read
that
a bug in asp.NET mite cause an error here in some cases(?)
Thanks again for your answer
Rea
"bruce barker" <no***********@safeco.com> wrote in message
news:#K**************@TK2MSFTNGP12.phx.gbl...
Context items only live for the life of the page requiest. they are
generally used to pass data between modules during a page request.
-- bruce (sqlwork.com)
"Rea Peleg" <re******@barak-online.net> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl... Hi eb
I am adding in webForm1.aspx some item to the context items collection
in order to extract it in the next aspx page:
In webForm1.aspx - c# code behind - i do:
---------------------------------------------------------------
Context.Item.add("variableName",variableVaue);
//test that add item succeeded:
string test = (string)Context.Item["variableName"];
if (test.Equals(variableVaue))
{
Server.Transfer(webForm2.aspx,true);
}
----------------------------------------------------------------
Then in webForm2.aspx :
string strVar = (string)Context.Item["variableName"];
Here strVar is null...
--------------------------------------------------------------
If i do the same procedure with session object instead - it works.
What am i missing??
Thanks for your attention
Rea