c# - to html from c# method
问题描述
good afternoon, I want to call from html a method that is in c #
<div>
<div id="divLista row-fluid">
<table id="tblLista" cellpadding="0" cellspacing="0" border="0" class="table table-hover table-bordered">
<thead>
<tr>
<th>Nº</th>
<th>Fecha</th>
<th>Doc</th>
<th>Imprimir</th>
</tr>
</thead>
<tbody>
<%
if (xItems != null)
foreach (var item in xItems)
{
Response.Write("<tr class='data-row'>");
Response.Write("<td>" + item.Id + "</td>");
Response.Write("<td>" + item.Fecha.ToShortDateString() + "</td>");
Response.Write("<td>" + item.Nro + "</td>");
**Response.Write("<td><asp:Button id='btnEdit' class='btn btn-round btn-info btn-xs' runat='server' onserver='btnEdit_ServerClick(" + item + ")') >Imprimir</asp:Button></td>");**
Response.Write("</tr>");
}
%>
</tbody>
</table>
</div>
</div>
</div>
C#
protected void btnEdit_ServerClick(object sender, EventArgs e)
{
MostrarError("afasdfsdf");
}
解决方案
推荐阅读
- ruby-on-rails - Wicked_PDF 未呈现正确的模板
- sml - 将字符串列表的每个元素在其自己的行上作为字符串输出 - sml
- python - Python - 从具有匹配键的字典中获取第一个值
- javascript - 在 IntelliJ 中阻止 Typescript 自动完成
- algorithm - 在这种情况下,“给出整体运行时间”是什么意思?
- javascript - 如何将字符串转换为对象以便能够将其作为函数参数传递
- jquery-terminal - 反转 JQuery-Terminal 的流程
- elastic-stack - ELK,本地机器上的 Filebeat 设置,Logstash 不工作,伐木工人协议错误
- php - PHP表格行编号
- sql - 如何在 SAS EG 中获取行号列以简化按该唯一编号选择行?我想使用 PROC SQL 语法