日期:2014-05-17  浏览次数:20682 次

页面控件重复的问题。Literal
aspx页面同时使用相同的控件不行啊, 本来title跟h1的值是一样的,用相同的控件是理所当然,怎么就不允许呢?
难道要再造一个不同ID的才行吗?真是的。。。

news.aspx:
HTML code
<head runat="server">
    <title><asp:Literal ID="title" runat="server" Text=''></asp:Literal></title>
</head>
<body>
    <form id="form1" runat="server">
    <div id="t_h1">
    <h1><asp:Literal ID="title" runat="server" Text=''></asp:Literal></h1>
    </div>
    <div id="content">
    <asp:Literal ID="content" runat="server" Text=''></asp:Literal>
    </div>

    </form>
</body>


------解决方案--------------------
ID必须唯一