Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

Saving UI state with cookie and jquery -


i'm trying save state of collapsible menu, , using jquery cookie plug in .. i'm having trouble far though.. help?

the script collapse/expand

<script type="text/javascript">     $(document).ready(function() {      $(".login-holder > ul > .logintitle").click(function() {         $(this).parent().find("li").slidetoggle("fast");         if ($(this).parent().find(".toggle").html() == "+") {             $(this).parent().find(".toggle").html("-");         } else {             $(this).parent().find(".toggle").html("+");         }     });    }) </script> 

the xhtml

<ul class="account-links">          <div class="logintitle">user options<span class="toggle">-</span></div>          <div class="menulinks">          <li>             <%= html.actionlink<eventcontroller>( x => x.list(), "events near me" )%>          </li>          <li>             <%= html.actionlink<myeventscontroller>( x => x.list(), "my events" )%>          </li>          <li>             <%= html.actionlink<accountcontroller>( x => x.edit(), "my profile" )%>          </li>          <li>             <%= html.actionlink<clubcontroller>( x => x.list(), "clubs near me" )%>          </li>          <li>              <%= html.actionlink<myclubscontroller>( x => x.list(), "my clubs" )%>          </li>          <li>             <%= html.actionlink<accountcontroller>( x => x.changepassword(), "change password" )%>          </li>          <li>             <%= html.actionlink<dependantcontroller>( x => x.list(), "my dependants" ) %>          </li>         </div>       </ul>    </div>   <% if ( viewmodel.profile.hasorganizerinfo ) { %>   <div class="login-holder">      <ul class="account-links">         <div class="logintitle">organizer details<span class="toggle">-</span></div>         <div class=menulinks>         <li>            <%= html.actionlink<accountcontroller>( x => x.organizer(), "organizer details" )%>         </li>         <li>            <%= html.actionlink<eventcontroller>( x => x.edit( default(int?) ), "post event" )%>         </li>         <li>            <%= html.actionlink<eventadmincontroller>( x => x.list(), "events created me" ) %>         </li>         <li>            <%= html.actionlink<clubcontroller>( x => x.edit( default( int? ) ), "create club" )%>         </li>         <li>            <%= html.actionlink<clubadmincontroller>( x => x.list( ), "clubs created me" )%>         </li>         </div>      </ul>   </div>   <% } %> 

one way i've done using cookies attach unload handler set cookie - did finding ids of classes not default (whether that's visible or hidden you), , saving them cookie. when page loaded again, check if cookie existed, , if did use string of ids selector apply toggled default class items saved earlier.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -