现在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"
%>

相关文章:

  • 2022-02-21
  • 2021-06-27
  • 2021-10-14
  • 2021-06-28
  • 2021-07-04
  • 2021-09-09
  • 2021-07-27
  • 2022-02-18
猜你喜欢
  • 2021-06-27
  • 2022-12-23
  • 2022-03-01
  • 2021-09-02
  • 2021-05-16
相关资源
相似解决方案