javascript - How to get jquery cloned html object in C# propery -
javascript - How to get jquery cloned html object in C# propery -
i have div in page contains input elements. want clone finish html of div can save in database , next time can retrieve cloned html , 1 time again render in page in exact same way @ time of saving including input values same @ time of saving.
i cloing html of div as:
var htmlobject= $('.mydiv').clone();
now above variable htmlobject of type object.
now in c# in model i've string type of property html:
public string html { get; set; }
but when send htmlobject server using ajax call, html property null. question should type of property html htmloject catched properties preserved next time when retrieve db , send client div should recreated same?
instead of using clone()
, returns dom object, grab string contents of div using:
var htmlstring = $('.mydiv').html();
you can pass htmlstring
straight c# string property html
.
edit: include input values in string, see include new input values when selecting dom using jquery
javascript c# jquery html model
Comments
Post a Comment