我在做DataGrid模板列时,当点击按钮列的【编辑】,我想让textbox的text属性显示表中userpassword字段的值,所以我在html代码中设置了如下几句:<EditItemTemplate>
<asp:TextBox id="TextBox1" runat="server" TextMode=Password>
<%#DataBinder.Eval(Container.DataItem,"userpassword")%>
</asp:TextBox></FONT>
</EditItemTemplate>运行的时候却报错:TextBox不能有类型为DataBoundLiteralControl的子级。
显然<%#DataBinder.Eval(Container.DataItem,"userpassword")%>是设置错误了,但同样设置label却没事,
小弟很不解,求指教……
<asp:TextBox id="TextBox1" runat="server" TextMode=Password>
<%#DataBinder.Eval(Container.DataItem,"userpassword")%>
</asp:TextBox></FONT>
</EditItemTemplate>运行的时候却报错:TextBox不能有类型为DataBoundLiteralControl的子级。
显然<%#DataBinder.Eval(Container.DataItem,"userpassword")%>是设置错误了,但同样设置label却没事,
小弟很不解,求指教……
解决方案 »
- 跪求用ASP.NET+SQLSERVER做的在线考试系统
- 用(ICSharpCode.SharpZipLib)压缩打包文件夹问题
- datagrid分页!删除一页的最后一条记录时会出错怎么解决?在最下面显示下一页时怎样也同时显示当前为第几页共几页?
- asp.net路径中的循环问题
- 为什么TreeView控件的“SelectedIndexChange”没有反应,闷...
- 同一台机器上,我要将数据库A中的表t_a的某些字段的数据copy到数据库B的某个表t_b的对应字段?如何做?
- ASP.NET如何在用户上传一张较大图片(1024*768 500K)时,自动生成一张较小图片(100*70 20K)
- aps.net如果一行多列,asp很简单的。
- 短消息问题
- 在asp.net里面怎么让一个用户的登录时间长一点(几个小时)
- 100分求助,如何在ASP.NET2.0中把GridView中的数据导出到excel文件中?
- 如何禁用页面上的按钮自动响应回车的时间,试过论坛里N中方法都不行,请高手指教
<asp:TextBox id="TextBox1" runat="server" TextMode=Password>
<%#DataBinder.Eval(Container.DataItem,"userpassword")%>
</asp:TextBox> </FONT>
</EditItemTemplate> //这显然是错的
<EditItemTemplate>
<asp:TextBox id="TextBox1" runat="server" TextMode=Password Text='<%#DataBinder.Eval(Container.DataItem,"userpassword")%> '>
</asp:TextBox>
</EditItemTemplate>