我正在将列表项添加到 Bulleted List 控件。
在列表项中,我希望对属性 class="" 进行编码。
请参阅下面的代码。class="" 被转换为class,右边的="" 被截断。
请务必注意,在代码中使用 scriptmanage/updatepanel 时会发生这种情况。否则,它似乎很好。
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManagerMain" runat="server" />
<asp:UpdatePanel ID="UpdatePanelMain"
runat="server">
<ContentTemplate>
<asp:BulletedList ID="BulletedList1" runat="server" DisplayMode="LinkButton">
<asp:ListItem Text="One" Value="1" class="active"></asp:ListItem>
<asp:ListItem Text="Two" Value="2" class=""></asp:ListItem>
<asp:ListItem Text="Three" Value="3" class=""></asp:ListItem>
</asp:BulletedList>
<asp:PlaceHolder ID="myplaceHolder" runat="server">
<asp:BulletedList ID="BL_Seasons" runat="server" DisplayMode="LinkButton">
</asp:BulletedList>
</asp:PlaceHolder>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>