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

推荐订阅源

N
News and Events Feed by Topic
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
T
Threat Research - Cisco Blogs
Cloudbric
Cloudbric
Recent Commits to openclaw:main
Recent Commits to openclaw:main
I
Intezer
Attack and Defense Labs
Attack and Defense Labs
P
Privacy International News Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
L
Lohrmann on Cybersecurity
C
Cybersecurity and Infrastructure Security Agency CISA
V2EX - 技术
V2EX - 技术
AWS News Blog
AWS News Blog
O
OpenAI News
L
LINUX DO - 最新话题
N
News | PayPal Newsroom
PCI Perspectives
PCI Perspectives
www.infosecurity-magazine.com
www.infosecurity-magazine.com
T
Troy Hunt's Blog
Latest news
Latest news
D
Darknet – Hacking Tools, Hacker News & Cyber Security
A
Arctic Wolf
Spread Privacy
Spread Privacy
G
GRAHAM CLULEY
T
Tor Project blog
博客园_首页
Know Your Adversary
Know Your Adversary
有赞技术团队
有赞技术团队
S
Secure Thoughts
美团技术团队
Apple Machine Learning Research
Apple Machine Learning Research
爱范儿
爱范儿
T
Tailwind CSS Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
V
Visual Studio Blog
J
Java Code Geeks
Cisco Talos Blog
Cisco Talos Blog
Schneier on Security
Schneier on Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Security Affairs
Jina AI
Jina AI
人人都是产品经理
人人都是产品经理
雷峰网
雷峰网
宝玉的分享
宝玉的分享
量子位
Last Week in AI
Last Week in AI
月光博客
月光博客
罗磊的独立博客
S
SegmentFault 最新的问题

博客园 - 沉默杨

[转]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


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