首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

脚本有关问题

2012-05-16 
脚本问题input typefile idfile+rows+Width297px onchangePreviewImg(this,\Hidden+rows+

脚本问题
<input type="file" id="file'+rows+'" Width="297px" onchange="PreviewImg(this,\'Hidden'+rows+'\',\'imgPreview'+rows+'\')" runat="server"/>
为什么这样脚本会出错,提示file'+rows+'”不是有效标识符
而去掉 runat="server"就不会出错,
请问要怎么改呢?

[解决办法]
id="file'+rows+'"
改成id=<%="file"+rows%>
[解决办法]
<%# Eval("rows")%>
[解决办法]

探讨
html控件不需要runat="server"吧

[解决办法]
runat="server" 

这个是不能存在的
[解决办法]
runat="server"
只可存在服务器控件中
[解决办法]
楼主,你的Id 是不是要进行绑定? 
Id不能够像你这样命名的。
如果需要进行绑定请:改成id= <%="file"+rows%>
如果不需要就另外取个名字吧~!

热点排行