p; </script>";
Page.RegisterStartupScript("dummyKey" + this.ID, adjustWidthScript);
//output.Write(adjustWidthScript);
}
else
{
//Replace the table''''s ID with a new ID.
//It is tricky that we must only replace the 1st occurence,
//since the rest occurences can be used for postback scripts for sorting.
sbRenderedTable.Replace(ID,ID + "_Headers", 0, (temp.IndexOf(ID) + ID.Length));
Trace.WriteLine(sbRenderedTable.ToString());
//We only need the headers, stripping the rest contents.
temp = sbRenderedTable.ToString();
string tableHeaders = temp.Substring(0, (temp.ToLower()).IndexOf(@"</tr>") + 5);
Trace.WriteLine(tableHeaders);
output.Write(tableHeaders);
output.WriteEndTag("table");
//Client side script for matching column widths.
//Can''''t find a way to do this on the server side, since the browser can change widths on the client side.
string adjustWidthScript = @"
<script language=javascript>
//debugger;
var headerTableRow = " + this.ID + @"_Headers.rows[0];
var originalTableRow = " + this.ID + @".rows[0];
headerTableRow.height = originalTableRow.offsetHeight;
for (var i = 0; i < headerTableRow.cells.length; i++) {
headerTableRow.cells[i].width = originalTableRow.cells[i].offsetWidth;
}
" +
//Also needs to adjust the width of the "<div>" at client side in addition to servier side,
//since the Table''''s actual width can go beyond the width specified at server side under Edit mode.
//The server side width manipulation is mainly for design-time appearance.
this.ID + "_div" + @".style.width = " + this.ID + @".offsetWidth + 20 + ''''px'''';
" +
//The following script is for flow-layout. We cannot get the position of the control 上一页 [1] [2] [3] [4] [5] 下一页 [Web开发]一个关于ASP运行时间计算的代码 [Web开发]ASP:检测含有中文字符串的实际长度 [Web开发]asp 中英文字符长度检测判断函数 [Web开发]安全维护 IIS asp 站点的高级技巧 [Access]ASP&SQL让select查询结果随机排序的实现方法 [Web开发]ASP字符串截取函数 [Web开发][asp]关键词只替换一次的写法 [Web开发]Asp无组件生成缩略图方法详解 [Web开发]asp编程中优化数据库方法详解 [Web开发]三种方法教你asp如何去除html标记
|