FineUI 官方论坛

标题: ExtAspNet.ControlUtil.FindControl(ExtAspNet.ButtonType.Button.GetType())问题 [打印本页]

作者: 做了才会想好    时间: 2013-3-26 21:19
标题: ExtAspNet.ControlUtil.FindControl(ExtAspNet.ButtonType.Button.GetType())问题
protected void Page_Load(object sender, EventArgs e)
        {
          Response.Write(ExtAspNet.ButtonType.Button.GetType().ToString());
           
         Control cntr= ExtAspNet.ControlUtil.FindControl(ExtAspNet.ButtonType.Button.GetType());
         // Response.Write(cntr.ID.ToString());
         for (int i = 0; i < cntr.ID.Length;i++ )
         {
             Response.Write("按钮" + i.ToString() + "=" + cntr.ID.ToString() + "<br/>");
         }
         
        }
我在页面上放置了ExtAspNet按钮,并设置按钮的type="Button",但cnstr输出结果为NULL值,怎么回事??

作者: sanshi    时间: 2013-3-27 11:14
这个例子很奇怪, Control cntr= ExtAspNet.ControlUtil.FindControl(ExtAspNet.ButtonType.Button.GetType());  这里cntr 是一个控件
          // Response.Write(cntr.ID.ToString());
          for (int i = 0; i < cntr.ID.Length;i++ )

cntr.ID 是个字符串,为啥对字符串的长度遍历




欢迎光临 FineUI 官方论坛 (https://fineui.com/bbs/) Powered by Discuz! X3.4