0

我有以下代码:

<%@ Page Title="Spam Filter, Free Exchange Spam Filter – Software to Stop Spam" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentBreadCrumb" Runat="Server">
    Welcome to > <a href="Default.aspx">Home</a>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentBodyMain" Runat="Server">
4

1 回答 1

0

您可以使用<asp:HtmlMeta>控件。在您编写的 .aspx 文件上:

<asp:HtmlMeta ID="descriptionMeta" runat="server" />
<asp:HtmlMeta ID="keywordMeta" runat="server" />

然后,从代码中,您可以执行此操作来设置内容等。

this.descriptionMeta.Name = "description";
this.descriptionMeta.Content = "description of the page or whatever";
this.keywordMeta.Name = "keywords";
this.keywordMeta.Content = "some,keywords,and,things";
于 2013-11-11T12:28:51.710 回答