checktb.Rows.Count
具估计应该是这个的问题
具估计应该是这个的问题
解决方案 »
- 输出字符串保存的值的值
- visual studio 2008中的datapager如何获取当前页的索引?急,在线等...
- GDI+中怎样让一个正方体旋转?
- DictionaryEntry的问题,在线等!!!
- 关于编写控件的几个小小的问题?
- C# 泛型委托的可逆变不能协变的问题?
- 如何在PictureBox中的图像上添加一些小符号标记(如小十字、小圆圈等)
- 谁有高速c#开文挡代码,
- 求救:使用API出错:对 PInvoke 函数“盘点数据读写测试!盘点数据读写测试.FormMain::hst_open”的调用导致堆栈不对称。
- 【在线急等】正则表达式提取
- Oledb读取csv文件的问题,总是自动将某些文本格式的列转换为数字格式(在线等)
- *********************高手请进,如何取得所有记录的值?*******************
checktb.Rows.Count有没有问题
错误提示贴出来
{
this.page.reg...alert('"+i.tostring()+'");
}
也只打印第一个"0"
1,2都没有打印
for(int i=0;i<j;i++)
// js的问题
response.write("<script>alert(i.tostring())</script>");
看看
能显示012这又能说明什么问题呢?
this.page不是跟它一样的意思吗?换成this.Page.RegisterStartupScript("b","<script>cloneLine();document.all.tbody1.children["+i.ToString()+"].children[0].firstChild.value='"+checktb.Rows[i][0].ToString()+"'</script>");还是只能显示并打印一行,和一个td 的值
function cloneLine() //增加一行
{
var t = tbody1.children.length;
var tmptr = tr1.cloneNode(true);
tmptr.id=null
tmptr.style.display="";
tmptr.children[0].innerHTML = '<input id="yha" name="yha" size=6>';
tmptr.children[1].innerHTML = '<input id="yhb" name="yhb" size=6>';
tmptr.children[2].innerHTML = '<input id="yhc" name="yhc" size=6>';
tmptr.children[3].innerHTML = '<input id="yhd" name="yhd" size=6>';
tmptr.children[4].innerHTML = '<input id="yhe" name="yhe" size=6>';
tmptr.children[5].innerHTML = '<input id="yhf" name="yhf" size=6>';
tmptr.children[6].innerHTML = '<input id="yhg" name="yhg" size=6>';
tmptr.children[7].innerHTML = '<input id="yhh" name="yhh" size=6>';
tmptr.children[8].innerHTML = '<input id="yhi" name="yhi" size=6>';
tmptr.children[9].innerHTML = '<input id="yhj" name="yhj" size=6>';
tmptr.children[10].innerHTML = '<input id="yhk" name="yhk" size=6>';
tmptr.children[11].innerHTML = '<input id="yhl" name="yhl" size=6>';
tmptr.children[12].innerHTML = '<input id="yhm" name="yhm" size=6>';
tmptr.children[13].innerHTML = '<input id="yhn" name="yhn" size=6>';
tmptr.children[14].innerHTML = '<input id="yho" name="yho" size=6>';
tmptr.children[15].innerHTML = '<input id="yhp" name="yhp" size=6>';
tbody1.insertBefore(tmptr);
}
this.Page.RegisterStartupScript("b","<script>cloneLine();document.all.tbody1.children["+i.ToString()+"].children[0].firstChild.value='"+checktb.Rows[i][0].ToString()+"'</script>");checktb.Rows.Count值为3,也就是你执行了3次RegisterStartupScript函数,这个函数的功能大概是为页面注册一个JS函数吧,但你连注3次且3次都名叫"b"????
ASP会不会不高兴? 大概用个StringBuider 把这个JS写好之后,再用RegisterStartupScript调用一次吧?