动态生成web表-asp.net table
2023-09-11 14:19:00 时间
1. 页面上定义一个server 的table
<table style="width: 100%" id="tbContent" runat="server">
</table>
2. 后台
HtmlTableRow rowQy = new HtmlTableRow();
HtmlTableCell cellHeadQty = new HtmlTableCell();
cellHeadQty.Width = "60";
cellHeadQty.Align = "left";
cellHeadQty.InnerText = "Total Demand Qty";
rowQy.Cells.Add(cellHeadQty);
for (int i = 1; i < 13; i++)
{
HtmlTableCell cell = new HtmlTableCell();
TextBox tb = new TextBox();
tb.ID = "tbQty" + i.ToString();
tb.Width = 50;
cell.Align = "center";
cell.Controls.Add(tb);
rowQy.Cells.Add(cell);
}
tbContent.Rows.Add(rowQy);
相关文章
- C# Asp.Net 判断字符串中是否包含指定字符或字符串(Contains/IndexOf)
- 使用 Visual Studio 部署 .NET Core 应用 ——.Net Core 部署到SUSE Linux Enterprise Server 12 SP2 64 位(GNOME 版本3.20.2)
- ASP.NET Core基于SignalR实现消息推送实战演练
- asp.net core 3.1 MVC/WebApi JSON 全局配置
- ASP.NET常用导出Excel方法汇总
- 【转载】ASP.NET MVC的过滤器【Filters】
- 《ASP.NET MVC4 WEB编程》学习笔记------Entity Framework的Database First、Model First和Code Only三种开发模式
- 《ASP.NET MVC4 WEB编程》学习笔记------HtmlHelper
- Asp.Net Web API 2第十七课——Creating an OData Endpoint in ASP.NET Web API 2(OData终结点)
- Asp.Net Web API 2第十课——使用OWIN自承载Web API
- asp.net url址址中中文汉字参数传递乱码解决方法
- ASP.NET Core 中的筛选器
- 通过微软的cors类库,让ASP.NET Web API 支持 CORS
- WCF 无法激活服务,因为它不支持 ASP.NET 兼容性。已为此应用程序启用了 ASP.NET 兼容性
- ASP.NET Core中的依赖注入(3): 服务的注册与提供
- 《ASP.NET Web API 2框架揭秘》样章(PDF版本)
- 跨域资源共享(CORS)在ASP.NET Web API中是如何实现的?
- ASP.NET Web API 2 入门教程
- ASP.NET Web Forms - Button 控件
- 用ASP.NET Core MVC 和 EF Core 构建Web应用 (一)
- asp.net core 图片验证码,后台验证
- ASP.NET Core Web API接收文件传输
- IIS7.5 部署asp.net 3.5 mvc2.0 网站 关键
- ASP.NET WEB+EntityFramework数据持久化——考核练习库——1、用户管理系统(考点:查询列表、增加、删除)