怎么绑定?我这个输入筐是要看条件才自动添加的!晕呀!好像没什么人关注我这个问题csdn上好像没有类似的问题呀!
解决方案 »
- 我这里有一个数组 string[] arrr = { "a", "b", "c", "d" };组成不同的组合
- c# 验证整型或浮点数字
- TreeView控件的TreeNodePopulate事件能触发几次?
- 为asp.net网站添加项目
- 三层 + 数据源分页 ,GridView 切换到其他页面时出问题了
- 关于ASP.NET 伪静态
- CS0246: 找不到类型或命名空间名称“PhotoVote”(是否缺少 using 指令或程序集引用?)
- 怪了,我的iis里的应用程序配置无法添加扩展名映射
- google浏览器兼容问题
- AjaxPro2 返回DataSet 时出现" 缺少对象"错误
- 新手问题!!!
- 谁用过FCKeditor,请问一下自己加了中文字体怎么是乱码,还有上传图片问题
想办法把条件的bool写到Visible里
{
TextBox TextBoxUrl = (TextBox)DataGrid1.Items[i].Cells[1].FindControl("TextBoxUrl");
if (TextBoxUrl !=null)
{
text=TextBoxUrl.Text;
}
}
TextBox TextBoxUrl=new TextBox();
TextBoxUrl.ID="TextBoxUrl";
TextBoxUrl.Text="http://";
e.Item.Cells[1].Controls.Add(TextBoxUrl);
然后去寻找 TEXTBOX
他会将您的TEXTBOX中的状态保存
这样textBox不会因为回传而消失,你也可以找到他并接受用户的输入。
因为我点击这个按钮以后还是在这个页面,所以在DataGrid1_ItemDataBound里面删除是执行不了的,点击按钮以后每项都显示textbox了!我是在DataGrid1_ItemDataBound事件里面直接删除的,
if (e.Item.Cells[4].Text!="6")
{
e.Item.Cells[1].Controls.Remove(e.Item.Cells[1].FindControl("TextBox2"));
}
我点击按钮后用
for (int i=0;i<DataGrid1.Items.Count;i++)
{
if (DataGrid1.Items[i].Cells[1].FindControl("TextBox2")!=null)
{
text=((TextBox)DataGrid1.Items[i].FindControl("TextBox2")).Text;
}
}
还是得不到呀!注:我的按钮不是在datagrid里面的
在你POSTBACK页面之后,请你重新添加
TextBox TextBoxUrl=new TextBox();
TextBoxUrl.ID="TextBoxUrl";
TextBoxUrl.Text="http://";
e.Item.Cells[1].Controls.Add(TextBoxUrl);
然后去寻找 TEXTBOX
他会将您的TEXTBOX中的状态保存
POSTBACK以后重新加载有什么用!我还是得不到他的值呀!
if (DataGrid1.Items[6].Cells[1].FindControl("TextBox2")!=null)
{
text=((TextBox)DataGrid1.Items[6].Cells[1].FindControl("TextBox2")).Text;
Response.Write("<script>alert('"+text+"')</script>");
}
text为什么是空呢?