Casting a session object to a generic object
-
Lets say you have code block like this public void BindGridData(IEnumerable result) { Session["result"] = result; gridView.DataSource = result; gridView.DataBind(); } How do you call this function in another event passing the Session["result"] as the argument? How do you cast Session["result"] back to the generic object? thanks
-
Lets say you have code block like this public void BindGridData(IEnumerable result) { Session["result"] = result; gridView.DataSource = result; gridView.DataBind(); } How do you call this function in another event passing the Session["result"] as the argument? How do you cast Session["result"] back to the generic object? thanks
You have already asked this in your previous post, please don't repeat it.
I know the language. I've read a book. - _Madmatt
-
You have already asked this in your previous post, please don't repeat it.
I know the language. I've read a book. - _Madmatt
-
You have already asked this in your previous post, please don't repeat it.
I know the language. I've read a book. - _Madmatt
-
Lets say you have code block like this public void BindGridData(IEnumerable result) { Session["result"] = result; gridView.DataSource = result; gridView.DataBind(); } How do you call this function in another event passing the Session["result"] as the argument? How do you cast Session["result"] back to the generic object? thanks
Sesion returns genaric objects, you have to cast them.
MyDataType result = Session["result"] as MyDataType;
-
I think you should take a deep breath before responding. If you want to get pissy about being told of the conventions and expectations of this community then perhaps you should step away for a bit. You have been given assistance on your problem, don't spoil it with such an attitude.
I know the language. I've read a book. - _Madmatt
-
Sesion returns genaric objects, you have to cast them.
MyDataType result = Session["result"] as MyDataType;
How bloody obvious :rolleyes: Now perhaps you'd like to actually read the OP's question.
I know the language. I've read a book. - _Madmatt
-
Sesion returns genaric objects, you have to cast them.
MyDataType result = Session["result"] as MyDataType;
-
There are a couple of very valid reasons for Marks reply to you. The most important reason is that it becomes very difficult to track answers if multiple threads are spawned about the same topic. Bear in mind that the question may be viewed, in the future, by others who want to know the answer to the problem; the search engines will point them to one thread. Churn and growth of other threads could mean that they end up not seeing the whole picture because the vital part of the answer is now in another thread. Now, take a deep breath and relax.
I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be
Forgive your enemies - it messes with their heads