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.

jquery - how to save dynamically changed ( byjquery ) html DOM? -


i got nice layout generator using jquery dynamic forms, , jquery ui features change number of used elements, css properties etc. looks great there 1 problem presentation of current result. save generated html dom , parse somehow ( delete hidden elements dom tree etc ). ideas how save current (modified) html + css?

solution using jquery follows:

step 1:

convert whole (modified) html string representation:

var html = $('html').clone(); var htmlstring = html.html(); 

step 2:

base64 encode htmlstring , put datauri inside hyperlink:

var datauri = "data:text/html;charset=utf-8;base64," + $base64.encode(htmlstring); $("body").append("<a href='" + datauri + "'>save</a>"); 

note: i'm using library base64 encoding above: http://hpyer.cn/codes/jquery-plugin-base64-encode-and-decode

step 3:

right-click on 'save' link dynamically created above , choose "save as" browser's context menu. modified html file saved new html document on local filesystem.

i've tried before , works. hope work , others well. solution works without server-side technology, nor require flash, java applets, active-x controls, xpcom or proprietary client-side technology. thing required (modern) browser supports data-uris.


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 -