惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
IT之家
IT之家
T
The Blog of Author Tim Ferriss
V
V2EX
博客园 - 聂微东
The Cloudflare Blog
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
U
Unit 42
Vercel News
Vercel News
L
LangChain Blog
博客园 - 司徒正美
H
Help Net Security
Recent Announcements
Recent Announcements
Recorded Future
Recorded Future
V
Visual Studio Blog
Jina AI
Jina AI
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
Y
Y Combinator Blog
C
Check Point Blog
博客园 - 三生石上(FineUI控件)
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
J
Java Code Geeks
The Register - Security
The Register - Security
The GitHub Blog
The GitHub Blog
B
Blog RSS Feed
F
Fortinet All Blogs
B
Blog
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
云风的 BLOG
云风的 BLOG
爱范儿
爱范儿
MongoDB | Blog
MongoDB | Blog
F
Full Disclosure
有赞技术团队
有赞技术团队
罗磊的独立博客
博客园_首页
MyScale Blog
MyScale Blog
aimingoo的专栏
aimingoo的专栏
Google DeepMind News
Google DeepMind News
M
MIT News - Artificial intelligence
N
Netflix TechBlog - Medium
Engineering at Meta
Engineering at Meta
量子位
I
InfoQ
小众软件
小众软件
P
Proofpoint News Feed

博客园 - 沉默杨

[转]ie6下表格宽度超宽bug,问题的解决方法(兼容ie6,7,8,ff) c#高级编程第六版读书笔记二(委托) c#高级编程第六版读书笔记 两列布局右侧自适应ie6bug - 沉默杨 - 博客园 iframe自适应宽度和高度 - 沉默杨 - 博客园 jquery选择器笔记 Sql Server 2005 row_number()分页性能测试比较 ie6兼容的bug调整 fckeditor提交失败返回内容变html的解决方法 .net环境下ckeditor与ckfinder学习笔记 ckfinder与fckeditor 2.6.5集成 seo.你的网站犯了多少错? 程序员必不可少的firefox插件推荐 SEO专题之七:如何提高PR值 seo专题之六:页面优化 最牛B的英汉翻译,笑傻了ba ... seo专题之五:title,keywords,description标签 SEO专题之四:如何合理有效选定关键字 SEO专题之三:SEO与网站开发
vs2010的bug
沉默杨 · 2010-04-30 · via 博客园 - 沉默杨

 准确的说,我不知道这是不是算vs2010一个bug,因为我对.net的运行机制也没啥太多的研究,基本上全靠自学,这个问题困扰了我两天,所有的方法都试遍了,还找了园子里面几个朋友帮忙,描述如下:

aspx页面继承adminpage.

代码

public partial class post_categories :AdminPage
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
rptList.DataSource
= Post.Getcategories(0);
rptList.DataBind();
}
}
}

adminpage页面

代码

public class AdminPage:System.Web.UI.Page
{
protected override void OnInit(EventArgs e)
{
if (!StatusObject.CheckCookie("user"))
{
WebHint.PageError(
"非法访问,你还没有登录" "../admin_login.aspx");

}

base.OnInit(e);
}
}

原意就是在adminpage类中判断cookie是否存在。不存在则返回到登录页面,就是这段代码导致了aspx页面所有的web控件全部无法显示。全部提示:

error creating error-控件id
Object reference set to an instance of an object

最终在msdn找到了答案,将判断cookie的这段代码先行注释了,恢复了正常,描述如下:

We are seeing this error because at the design time, some objects such as Session, are not available, or being null. However, the project still runs perfectly at runtime.

To workaround the issue, you can add code to check for the existence of the Session object as shown below, then the design view will render correctly.
We are considering adding a fix for this issue during the VS 2010 SP1 timeframe.
详见:http://blogs.msdn.com/webdevtools/archive/2010/04/15/rendering-issue-in-visual-studio-2010-when-accessing-the-session-state-in-the-oninit-method.aspx


  困扰了两天的问题解决,心里面真是一块石头落地,文章很初级,如果管理员觉得不合适,可以撤下首页。
  顺祝:“五一节快乐”