Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have two options:</p> <ul> <li>Client side cookie</li> <li>Store UI settings server side via postback or webmethod calls</li> </ul> <p>The second option will require alot more effort but would allow you to provide 'portable' UI settings that could be applied for a user regardless of client machine. If the settings are 'throw-away', I would go for client side cookies.</p> <p>How to work with javascript and cookies:</p> <p><a href="http://techpatterns.com/downloads/javascript_cookies.php" rel="nofollow noreferrer">http://techpatterns.com/downloads/javascript_cookies.php</a></p> <p>I generally store UI settings server side in a database via postbacks, however if users are changing their UI via jQuery and you want to persist those changes, I would probably go about it something like this:</p> <ul> <li>add a script manager to your aspx page</li> <li>set EnablePageMethods="true"</li> <li>create a WebMethod in your codebehind </li> <li>in your jQuery methods that update the UI, add a call to your WebMethod and pass back the UI setting</li> <li>store any settings passed to the WebMethod in the database</li> <li>then when the user visits the page the next time, either fetch the settings and populate as many controls server side as you can, or use the jQuery ready method to make a call to another webmethod that fetches the UI settings from the database, passes them back to jQuery allowing you to populate the controls.</li> </ul> <p>Here is a decent article on jQuery and WebMethod calls:</p> <p><a href="http://encosia.com/2008/05/29/using-jquery-to-directly-call-aspnet-ajax-page-methods/" rel="nofollow noreferrer">http://encosia.com/2008/05/29/using-jquery-to-directly-call-aspnet-ajax-page-methods/</a></p> <p>The problem you will need to be aware of is EventValidation; you will get into trouble if you fetch control values outside of the scope of the page lifecycle and then expect to use those settings on postback. For example, adding values to a dropdownlist via a webmethod will throw an error on postback, unless those values were also added to the dropdownlist when the page was built.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload