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

推荐订阅源

V
Visual Studio Blog
Stack Overflow Blog
Stack Overflow Blog
G
Google Developers Blog
Microsoft Azure Blog
Microsoft Azure Blog
Engineering at Meta
Engineering at Meta
L
LangChain Blog
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
Y
Y Combinator Blog
月光博客
月光博客
雷峰网
雷峰网
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Fortinet All Blogs
A
About on SuperTechFans
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
小众软件
小众软件
H
Help Net Security
Last Week in AI
Last Week in AI
B
Blog RSS Feed
宝玉的分享
宝玉的分享
N
Netflix TechBlog - Medium
博客园 - 叶小钗
The GitHub Blog
The GitHub Blog

博客园 - 真见

用户中心 - 博客园 如何在ASP.NET中使用Windows Live Web Bar 博客园的一篇好文 Internet Explorer 8.0 正式版 提交按钮OnCheck之后的技巧 - 真见 - 博客园 如何在ASP.NET中使用Syndication创建一个RSS源 如何创建Sql Server数据库关系图 + Silverlight 2 GDR1 发布 如何在ASP.NET中使用验证通过的Windows Live ID用户登录网站 Using-更精彩更有用的做法-短签名 我的Windows 7系统 Internet Explorer 8 RC1发布 新浪首届我的创业路征文大赛初评榜单公布 得到微软DevWow博客达人征文大赛优秀奖,奖得微软T-Shirt一件 我的五项 Windows Live Writer 使用习惯分享 + 来自 Jackson Fish Market 的虚拟鲜花赠送服务推荐 摇滚真见的生日 Sueetie源代码发布【 推荐 】 中国版 Windows Live Wave3 介绍站点 ASP.NET网站编程人员2008年技术文章参照 Visual Studio可视化IDE风格主题参照
ASP.NET WebForms 4.0 新属性
真见 · 2009-02-04 · via 博客园 - 真见

现在ASP.NET 4.0已经有了培训教程:http://channel9.msdn.com/shows/10-4/10-4-Episode-3-ASPNET-WebForms-40/, 更深入的系列可以看:http://channel9.msdn.com/shows/10-4

ASP.NET4.0---Page新属性

ASP.NET 4.0 WebForms在Page上是增加了两个新属性,一个是Page.Keywords,一个是Page.Description。

以前是:

<head runat="server">

    <title>Untitled Page</title>

    <meta name="keywords" content="SampleKeywords" />

    <meta name="description" content="SampleDescription" />

</head>

现在是 设在页面指令顶部:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MetaWeblogSample._Default" 
    Keywords="SampleKeywords" Description="SampleDescription"
%>

与 后台编程:

protected void Page_Load ( object sender, EventArgs e ) {
          this.Page.Keywords = "SampleKeywords";
          this.Page.Description = "SampleDescription";
          Response.Write ( "" );
 }

这里还有个简单的小工具:http://www.apogee-web-consulting.com/tools/keyword_tool.php

ASP.NET4.0---ASP.NET控件新增的ViewStateMode属性

至于ASP.NET 4.0为什么会这样做,可以先看看这篇文章:http://www.infoq.com/cn/news/2009/01/ASP-4-View-State, ASP.NET控件的ViewStatMode属性可能有3个值:Enabled, DisabledInherit。

除了在控件上有这个属性,在Page上也新增了:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MetaWeblogSample._Default" 
    ViewStateMode="Disabled"
%>