public void Page_PreInit()
{
// Sets the Theme for the page.
this.Theme = "Blue";
if (Request.Form != null && Request.Form.Count > 0)
this.Theme = this.Request.Form["4"].Trim(); }
this.Request.Form["4"] 为什么是4 而不是其他的,
为什么把它换成this.Theme = this.Request.Form["ddlThemes"].Tostring().Trim();就报错,
谢谢
{
// Sets the Theme for the page.
this.Theme = "Blue";
if (Request.Form != null && Request.Form.Count > 0)
this.Theme = this.Request.Form["4"].Trim(); }
this.Request.Form["4"] 为什么是4 而不是其他的,
为什么把它换成this.Theme = this.Request.Form["ddlThemes"].Tostring().Trim();就报错,
谢谢
解决方案 »
- 要根据gridview 里面模板列的dropdownlist 的显示的值 判断是否删除
- 问一下大家的MSDN是中文还是英文版的呀?
- |zyciis| 我新建了一个类库,然后在里面添加了一些类,和几个js,和几张图片,我生成dll后,类里面的方法可以用,但里面的js和图片我在网页中如何调用 谢谢 常文件结构和内容
- 谁能说说目前asp.net2.0最好的url重写代码或组件?
- 分析器错误 未能加载类型“_Default”
- 这两种实现方式的区别?
- DropDownList的奇怪问题
- asp.net+access,update语句,不报错,不更新
- 12333333333
- 网站源码打包8张DVD30G350元
- 如何解决白屏问题
- 如何得到程序运行站点的主机头信息?
不行
有错误 如下: 将对象引用设置到对象的实例。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.NullReferenceException: 未将对象引用设置到对象的实例。源错误:
行 21: this.Theme = "Blue";
行 22: if (Request.Form != null && Request.Form.Count > 0)
行 23: this.Theme = this.Request.Form["ddlThemes"].ToString().Trim();
行 24:
行 25: }
是不是 Page_PreInit 事件,页面的控件还没有加载?