c# - 查找控件返回 null
问题描述
当我试图在当前页面上找到一个控件时,它每次都返回 null 并且控件就在那里。
HTML:
<input type="radio" id="test2" value="Hello World" name="Test"/>
代码背后
HtmlInputRadioButton control = (HtmlInputRadioButton)Page.FindControl("test2");
Response.Write(control.Value);
Response.Write(control.ID);
知道为什么它一直返回 null 吗?
解决方案
推荐阅读
- isabelle - 如何在 Isabelle/HOL 术语中包含有关变量类型的声明
- java - Oracle 存储过程性能缓慢
- java - Camel K Rest 路由需要 JSON 编组并执行注释代码
- html - 让表格行可滚动
- apache - Apache2通过域名访问时找不到请求的URL,但通过IP地址完美运行?
- jquery - 如何获取表格单元格中的输入值
- javascript - 如何用 laravel 实现 vue3 ssr?(V8Js::compileString():15132: TypeError: Cannot read property 'render' of undefined)
- c# - 即使两个对象相同,C# Net.Core Object.Equals() 也会返回 false
- javascript - 是的验证——确保一个数组至少包含一项
- google-sheets - 从引用的单元格更改单元格时,如何突出显示该单元格?