<meta name="keywords" content="<%=keywords%>"/>
为什么直接输出
<meta name="keywords" content="&lt;%=keywords%>" /><meta name="keywords" content="<%Response.Write(keywords)%>"/>
为什么直接输出
<meta name="keywords" content="&lt;%Response.Write(keywords)%>" />
content="<%=keywords%>" 为什么不输出keywords 值啊. 这咋整
引号放入keywords中可以,但是有的情况不允许啊.

解决方案 »

  1.   

    这跟母版页有关
    就像母板也上放flash一个道理
      

  2.   

    <meta name="description" content='<%= GetDescription() %>' />
    <meta name="keywords" content='<%= GetKeyWords() %>' />
      

  3.   

    <meta name="keywords" content="&lt;%= GetKeyWords() %>" />你那里行? 直接当字符处理.
      

  4.   

    你如果用了母版页的话,可以参考以下方法,我也遇到过你的问题。
    <head runat="server">
      <title>无标题页</title>
      <meta content="" name="keywords" id="key3"/>
      <meta content="" name="description" id="des3"/>  
    </head>.cs中
    public partial class xx : System.Web.UI.Page
    {
      public string keywords = "";
      public string description = "";  protected void Page_Load(object sender, EventArgs e)
      {
      HtmlMeta keywords = (HtmlMeta)Master.FindControl("key3");
      keywords.Content = "keywords";
      HtmlMeta description = (HtmlMeta)Master.FindControl("des3");
      description.Content = "content";
      }
    }
      

  5.   

     是个解决方法, 但还不如我keywords 里面直接放引号.