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.

asp.net - save client html changes -


i have div element contains ul element starts off empty when page first loaded. user can drag li elements div box populate ul element. need able retain li elements have been added ul container can show li elements after post back. how can achieve this?

<div class="sidebar-drop-box">                                <p class="droptitle"><strong>drop box</strong><br />                        drag , drop tracks here temporarily if you’re working long playlist.</p>                    <ul class="admin-song-list"></ul>            </div> 

the drag , drop done javascript , jquery. of sits on asp.net page. when drag completed code executed

function addtodropbox(obj) {     $(obj).children(".handle").animate({ width: "20px" }).children("strong").fadeout();     $(obj).children("span:not(.track,.play,.handle,:has(.btn-edit))").fadeout('fast');     $(obj).children(".play").css("margin-right", "8px");     $(obj).css({ "opacity": "0.0", "width": "284px" }).animate({ opacity: "1.0" });     if ($(".sidebar-drop-box ul").children(".admin-song").length > 0) {         $(".droptitle").fadeout("fast");         $(".sidebar-drop-box ul.admin-song-list").css("min-height", "0");     }     if (typeof setlinks == 'function') {         setlinks();     } 

so tried code below go through , elements suppose in drop down box , put them back. didnt add them drop box made changes master list

//repopulate drop box     if(document.getelementbyid("ctl00_cphbody_hfremovemedia").value!="")         {             var localremovemedias=document.getelementbyid("ctl00_cphbody_hfremovemedia").value.split(",");             $(".admin-left li.admin-song").each(function(){ //                alert("ineach");//works                 for(x in localremovemedias)                 {                     if($(this).attr("mediaid")==localremovemedias[x])                     {                         addtodropbox($(this));                     }                 }//end             });//function(){         } 

to retain dragged elements across postback suggest store elements ids in asp:hiddenfield user drag/drop operations.

when postback occur ids persisted , able recreate page state before postback.


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 -