2, c #
[the WebMethod]
Public static string drawCHK (string id)
{
HtmlStr +="& lt; Table width="400" border='1' cellpadding='1' cellspacing='1' & gt; ";
For (int I=0; I & lt; 5; I++)
{
HtmlStr +="& lt; Tr>
}
HtmlStr +="& lt;/table> ";
LrCon. Text=htmlStr;
Return "OK".
}
CodePudding user response:
Trouble you to provide an effective way, didn't find the right online, practical examplesCodePudding user response:
In the dynamic method is easy to realize the function of in a static method can not make, we faced similar examples?CodePudding user response:
Background have & lt;> This kind of character escaping into & amp; gt; & lt; TheCodePudding user response:
What is the effective solution? Front desk controls can dynamically generatedCodePudding user response:
Temporarily haven't good way, the data back to the js painting inside the tableCodePudding user response:
Linq + reapterAspx:
The column name & lt;/td> | The column name & lt;/td> | The column name & lt;/td> |
<% # Eval (" checkbox ") % & gt; | <% # Eval (" lable ") % & gt; |
C #
Var DataSource=the from f in dt. AsEnumerable () to select the new
{
The checkbox="& lt; Input type='checkbox value=' "+ f.F ield(" column ") + "'/& gt;" ,
Lable="& lt; Label>" + f.F ield(" column ") + "& lt;/label>"
};
This. The RPT. The DataSource=DataSource;
RPT. DataBind ();