我需要将 devexpress 控件(例如复选框)“翻译”为控制器中的 html 字符串。就像它在页面上看起来一样。请告知如何做。
页:
<input name="myCheckBox" id="chB_S" style="width: 0px; height: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; position: relative; background-color: transparent;" readonly="readonly" value="I"/>
控制器:
CheckBoxSettings s = new CheckBoxSettings();
s.Name = "myCheckBox";
s.Properties.ClientSideEvents.ValueChanged = "function(s,e){alert('Selection changed');}";
CheckBoxExtension chBut = new CheckBoxExtension(s);
string zzz = chBut.GetHtml().ToHtmlString(); //Get empty string instead of html