I have the following situation… In a certain View, the user must select the initial hour, the final hour and the weekday. But, I can't save this informations to DB 'cause I need to save my whole page and I need the primary key of the primary table, but that's not the point.
So, while I don't save these data to DB, I'm saving to a Session. I was told to save to a cookie, but it appears that cookies have a size limit. So, I'm saving to a Session.
Buuuut, I was also told that I could save these informations (hours and weekday) to the user page, simulating a ASP.NET ViewState…
Does anyone know how to do this?? Does anyone know how to save temporarily these data withou using cookie or Session??
Hidden input fields won't help?
Update (serializing an object to base64):
When you want to fetch it back:
Make sure you validate the data stored in the field when you use it as the client might change it.
ViewStatetakes care of this automatically.
Side note: ASP.NET uses
ViewStateas it's more efficient or ASCII based serialization. You might want to consider that too.