Updatepanel与复选框问题 [英] Updatepanel with checkboxes problem

查看:80
本文介绍了Updatepanel与复选框问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在更新面板中有4个复选框,但是当我想在其后面的代码中使用它们时,表明未声明控件,因此不胜感激.
非常感谢.

I have 4 checkboxes in an update panel but when I want to use them in a code behind it shows that control is not declared, any help appreciated.
Many thanks.

推荐答案

控件是面板的子级,而不是表单的子级.使用类似这样的内容:

The control is a child of the panel, not the form. Use something like this:

updatePanel1.checkBox1.Checked = true;


通过此访问控件表示checkBox1.Checked
access your control by this means checkBox1.Checked


1]在设计器中签入是否已分配runat ="server"属性.
2]检入设计器.cs文件,按其名称找到控件,如checkbox1,它必须存在.
3]检查页面是否成功继承自System.Web.UI.Page.
4]检查您的控件是否是asp.net控件.
1]check in designer it has runat="server" property is assigned or not.
2]check in the designer .cs file find the control by it''s name as checkbox1 it has to be there.
3]check is the page is successfully inherited from System.Web.UI.Page or not.
4]check is your control is asp.net control or not.


这篇关于Updatepanel与复选框问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆