javascript - Modal that gets populated inline does not accept quotation marks -
i'm building dynamic homepage has modal data gets set onclick. building admin tools - includes html editor devexpress. want html code written in editor modal, right - if there quotation marks anywhere in code, modal writes properties link doesn't work.
here html modal
<div id="modal" class="container"> <div class="modal fade" id="mymodal" aria-labelledby="mymodallabel"> <div class="modal-content" style="padding: 20px; border-radius: 25px; padding-bottom: 50px;"> <button type="button" class="close" data-dismiss="modal" aria-label="close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="mymodallabel"></h4> <div class="modal-body" id="mymodalbody"></div> <button type="button" class="btn btn-default pull-right" data-dismiss="modal">stäng</button> </div> </div> </div>
in code behind made reuse wherever need it:
public static string lanktyp1enkel = "<button type=\"button\" class=\"btn btn-link\" data-header=\"{header}\" onclick=\"$('#mymodallabel').html($(this).data('header')); $('#mymodalbody').html($(this).data('body'))\" data-body=\"<p>{text}</p>\" data-toggle=\"modal\" data-target=\"#mymodal\">{linktext}</button>";
then call on button click test out:
protected void aspxbutton1_click(object sender, eventargs e) { string html = @htmleditorpillista.html; string h = @mallar.lanktyp1enkel.replace("{header}", "en header").replace("{linktext}", "en länk"); h = h.replace("{text}", @html); divven.innerhtml = h; }
i want able style text written in html editor using editor editor :)
i have tried replace " double ' of thing, style text "s needed! modal needs does, in yes, needs inline.
Comments
Post a Comment