我正在尝试使用单选按钮列表来更改更新面板中的一些标签文本,但无论出于何种原因,SelectedIndexChanged 事件似乎只会第一次触发,然后再也不会触发。我用谷歌搜索和搜索,但我发现尝试的所有东西都没有解决这个问题。
Autopostback 设置为 true,我尝试了标准的 .net ScriptManager 和 ToolkitScriptManager,两者的行为相同,我尝试在 Trigger 中指定 Event 并未指定它(这会退回到该控件类型的默认值) ...我还尝试将 rbl 绑定到 if not me.ispostback then... 页面加载事件的结构中。
我在事件中使用的 VB 只是一个简单的 如果选择了这个索引, label.text="whatever" else "yadda" ... 没什么特别的。如果更新面板不在播放中,这一切都很好,除了我希望从完整的回发中摆脱屏幕闪烁。我把我的asp.net的肉和土豆贴在下面……救命!
类型1 类型2 <asp:Panel ID="DesignInfoHeaderPanel" runat="server" CssClass="headerpanel">
<asp:Label ID="lblDesignInfo" runat="server" font-bold="true"
style="z-index: 1; left: 5px; top: 5px; position: absolute" Text="Design Information"></asp:Label>
</asp:Panel>
<div class="cpdiv">
<asp:Panel ID="DesignInfoPanel" runat="server" CssClass="collapsepanel">
<asp:UpdatePanel runat="server" ID="DIUpdatePanel" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" font-bold="true"
style="z-index: 1; left: 5px; top: 7px; width: 95px; position: absolute; text-align: right"
Text="Account Name"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server" Font-Names="Verdana" Font-Size="8pt"
style="z-index: 1; left: 110px; top: 4px; width: 144px; position: absolute"></asp:TextBox>
<asp:Label ID="Label2" runat="server" font-bold="true"
style="z-index: 1; left: 270px; top: 7px; width: 140px; position: absolute"
Text="Est. Volume (# units)"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" Font-Names="Verdana" Font-Size="8pt"
style="z-index: 1; left: 415px; top: 4px; width: 60px; position: absolute"></asp:TextBox>
<asp:Label ID="Label3" runat="server" font-bold="true"
style="z-index: 1; left: 7px; top: 35px; width: 95px; position: absolute; text-align: right"
Text="Sales Manager"></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server" Font-Names="Verdana" Font-Size="8pt"
style="z-index: 1; left: 110px; top: 32px; width: 150px; position: absolute">
</asp:DropDownList>
<asp:Label ID="Label4" runat="server" font-bold="true"
style="z-index: 1; left: 485px; top: 7px; width: 140px; position: absolute"
Text="Personalization Type"></asp:Label>
<asp:DropDownList ID="DropDownList2" runat="server" Font-Names="Verdana" Font-Size="8pt"
style="z-index: 1; left: 630px; top: 4px; width: 150px; position: absolute">
</asp:DropDownList>
<asp:CheckBox ID="CheckBox1" runat="server" font-bold="true"
style="z-index: 1; left: 298px; top: 32px; position: absolute" Text="Rental"
TextAlign="Left" />
<asp:CheckBox ID="CheckBox2" runat="server" font-bold="true"
style="z-index: 1; left: 397px; top: 32px; position: absolute" Text="Dir Sales"
TextAlign="Left" />
<asp:RadioButtonList ID="RadioButtonList1" runat="server" BorderColor="#640000"
BorderStyle="Solid" BorderWidth="2px" Font-Bold="true"
RepeatDirection="Horizontal"
style="z-index: 1; left: 545px; top: 28px; position: absolute"
TextAlign="Left">
<asp:ListItem Value="0">Type1</asp:ListItem>
<asp:ListItem Value="1">Type2</asp:ListItem>
</asp:RadioButtonList>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="rblEmblemType" />
</Triggers>
</asp:UpdatePanel>