HtmlGenericControl(QUOT; TD")合并单元格 [英] HtmlGenericControl("td") colspan

查看:155
本文介绍了HtmlGenericControl(QUOT; TD")合并单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来asp.net C#所以请任何人都可以帮我下面code:

  VAR TD1 =新HtmlGenericControl(TD);

我怎样才能让这个TD colspan设为anyvalue?

连我如何添加ID或类值?


解决方案

您需要将其添加到 HtmlGenericControl.Attributes


  

HtmlControl.Attributes地产获取所有的集合属性的名称和值对前pressed在ASP.NET页内的服务器控件标记。


示例

  VAR TD1 =新HtmlGenericControl(TD);
td1.Attributes.Add(列跨度,1); //替换1,正确的值。

更多信息

I am new to asp.net c# so please anyone can help me with below code:

var td1 = new HtmlGenericControl("td");

How can I make this td colspan to anyvalue?

Even how can I add id or class value?

解决方案

You need to add it to the HtmlGenericControl.Attributes collection

HtmlControl.Attributes Property Gets a collection of all attribute name and value pairs expressed on a server control tag within the ASP.NET page.

Sample

var td1 = new HtmlGenericControl("td");
td1.Attributes.Add("colspan", "1"); // replace "1" with the correct value.

More Information

这篇关于HtmlGenericControl(QUOT; TD")合并单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆