在运行时设置asp:tableHeader的ColumnSpan [英] setting ColumnSpan of asp:tableHeader at runtime

查看:122
本文介绍了在运行时设置asp:tableHeader的ColumnSpan的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< asp:TableHeaderCell CssClass ="CellWidth1" ColumnSpan =<%= IncAdd%>">

无法在运行时动态设置ColumnSpan来纠正格式

<asp:TableHeaderCell CssClass="CellWidth1" ColumnSpan="<%=IncAdd%>">

not able to set ColumnSpan dynamically at runtime to correct formeting

推荐答案

似乎变量IncAdd不在范围内或未初始化,或者其设置为alpha数值.

试试这个...
It seems, the variable IncAdd is out of scope or not initialized or it is set with alpha numeric value.

Try this...
protected string IncAdd=string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
    IncAdd = "17";//your logic goes here
}



还要交叉检查,您在变量中设置了什么值.如果它是字母数字,则交叉检查您的代码.

希望这会有所帮助.
欢呼



Also cross check, what value you set into the variable. If it is alpha numeric, then cross check your code.

Hope this helps.
cheers


看,该错误表示它的意思.因此,如果您听不懂该错误消息,则应该发布该错误消息. IncAdd是一个字符串.将其设置为int即可使用.消息就是这么说的.
See, the error means what it says. It''s for this reason that you should post the error message, if you can''t understand it. IncAdd is a string. Make it an int, and it will work. That''s what the message says.


服务器端代码中的

TableHeaderCell obj =(TableHeaderCell)lTable1.Rows [5] .FindControl("tempid");
obj.ColumnSpan = 17;
IN SERVER SIDE CODE

TableHeaderCell obj = (TableHeaderCell)lTable1.Rows[5].FindControl("tempid");
obj.ColumnSpan = 17;


这篇关于在运行时设置asp:tableHeader的ColumnSpan的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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