Developer forum

Forum » Development » ViewState

Reply
Good day,

I'm trying to find something similar to the useful ViewState in DynamicWeb without success.

Can you help me with this?

Thanks for the help.

Replies

 
Reply
Hi there,

Because of the way Dynamicweb renders your HTML, there's no such thing as View State for the front end of custom modules. You can, however, create a User Control instead of a full blown custom module as discussed here: http://devierkoeden.com/Articles/[articleId/21]/Custom-Functionality-–-Using-User-Controls.aspx

Additionally, since backend pages are fully ASP.NET, you can use ViewState as you normally would. This is discussed here: http://devierkoeden.com/Articles/[articleId/22]/Custom-Modules---Part-5---Building-Modules-with-a-Module-Admin-Page.aspx

What exactly are you trying to accomplish? E.g. where and why do you need ViewState? There may be alternatives available.

Cheers,

Imar
 
Reply
Thanks!

I gonna try that idea, an user control could be a good fix.

I need the ViewState because is a simple way to save data (client side), for example, I have a form for search information about travels and when the user wish make another search the ViewState has all the fields stored.

You have a lot ways to do that without the ViewState, but is an easy way to do it.

This is a custom ViewSate if somebody need it, support compression and custom RijndaelAlgKey - RijndaelAlgIV for encrypt data. Just save the string in a simple "input hidden".

If you can improve it, will be welcome.

Thanks the support.
 
Reply
>> I need the ViewState because is a simple way to save data (client side), for example, I have a form for search information about travels and when the user wish make another search the ViewState has all the fields stored.

Technically, it's not ViewState that does this for you, but control state and the ASP.NET state engine, which is still available. However, I agree state management is easier in true ASP.NET pages than it is in Dynamicweb. With custom modules you need to populate the controls yourself after a postback from the Request.Form collection, rather like it was done in classic ASP.

Interesting solution on a custom view state engine; thanks for sharing.

Cheers,

Imar

 

You must be logged in to post in the forum