Possible way to pass object(state) between ASP.NET pages

I just came across this very simple solution to pass object state between asp.net applications. I Don't know if it is a good way of pasing objects between pages or if there is a better solution. But this one seems pretty straight forward.

Published Tue, Jan 4 2005 8:25 AM by Patrick Wellink
Filed under:

Comments

# re: Possible way to pass object(state) between ASP.NET pages

Tuesday, January 04, 2005 12:59 PM by Patrick Wellink
Indeed, a <b>simple</b> solution, but only usable for <b>simple</b> objects.
Not every object is this easily serializable...

But thanks for the info anyway, Patrick ;)

# re: Possible way to pass object(state) between ASP.NET pages

Tuesday, January 04, 2005 2:57 PM by Patrick Wellink
I don't think the object itself is a problem here, I think it's the length of the url that's the problem.

According to the following kb article, the max length in Internet Explorer can only be 2048 characters.

http://support.microsoft.com/kb/q208427/

And besides that, there are way, way more possibilities! Store it in session, in cache, make a post and submit it to another form, etc, etc.

Most of the time I use hidden fields to store stuff and try to keep away as much possible from both session and querystring.

Btw, the example got the querystring with the code : Request["obj"].ToString()
That in itself already sucks, because what this functionally does is walk through all options (form, querystring and session) untill it has a match.

Why not use querystring, like you yourself specified? It's faster, more secure and much, much more readable.

I think in all this is a bad example of how to pass objects between pages. However, the writer says he wanted to pass between APPLICATIONS! This, I am sure, can be done much better and does not need a crappy solution like this.

# re: Possible way to pass object(state) between ASP.NET pages

Tuesday, January 04, 2005 3:06 PM by Patrick Wellink
Ok thanks that was a littlebit the kind of comment I was looking for.....

It was a way I hadn't seen before. I usually use the cache.




# re: Possible way to pass object(state) between ASP.NET pages

Tuesday, January 04, 2005 7:37 PM by Patrick Wellink
@Dennis,
What you suggest is nice and common practice but less- or none-usable for passing objects from one application to the next and that's what this example is about.
Then it gets more complicated. You cannot share sessions because the two webapps are separate processes.
But I agree that this is a questionable way of doing things...

# re: Possible way to pass object(state) between ASP.NET pages

Tuesday, January 04, 2005 9:33 PM by Patrick Wellink
@Ernst: Do you always repeat what I say? ;)

Come on mate, that's what I said.

# re: Possible way to pass object(state) between ASP.NET pages

Wednesday, January 05, 2005 8:22 AM by Patrick Wellink
I just wanted to point out that the first part of your reaction wasn't relevant to the goal that this solution was trying to achieve.

BTW: I don't think that there is a nice and clean way to pass data from one webapp to the next...

Leave a Comment

(required) 
(required) 
(optional)
(required) 
Please add 8 and 7 and type the answer here: