在选择触发回发的任何单选按钮或表单事件时,我的单选按钮列表选择转到索引 0。其他表单项均不受影响。我禁用了主列表重定向代码,我创建了一个全新的页面,其中除了下拉列表、单选按钮列表和用于查看所选数据的标签之外什么都没有。我难住了。
有什么建议吗?我只希望它保留 selectedindex 并允许我在回发之间填充正确的值。
<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="s_Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder_menuBar" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder_userBar" Runat="Server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder_mainActivityWindow" Runat="Server">
<form id="Form1" runat="server">
<p>
<asp:DropDownList ID="ddl_Shift1" runat="server" AutoPostBack="true" EnableViewState="true">
<asp:ListItem Text="d" Value="d" Selected="True"></asp:ListItem>
<asp:ListItem Text="n" Value="n" Selected="False"></asp:ListItem>
<asp:ListItem Text="h" Value="h" Selected="False"></asp:ListItem>
</asp:DropDownList>
</p>
<p>
<asp:RadioButtonList ID="rbl_C112" runat="server" AutoPostBack="true" EnableViewState="true">
<asp:ListItem Text="2" Value="112" Selected="False" ></asp:ListItem>
<asp:ListItem Text="3" Value="112" Selected="False" ></asp:ListItem>
<asp:ListItem Text="4" Value="112" Selected="False" ></asp:ListItem>
<asp:ListItem Text="5" Value="112" Selected="False" ></asp:ListItem>
<asp:ListItem Text="Unassigned" Value="112" Selected="True" ></asp:ListItem>
</asp:RadioButtonList>
</p>
<p>
<asp:Label ID="l_c112" Text="" runat="server"></asp:Label>
<asp:Label ID="username" Text="" runat="server"></asp:Label>
</p>
</form>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ContentPlaceHolder_tutorialBar" Runat="Server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="ContentPlaceHolder_foot" Runat="Server">
</asp:Content>
VB Codebehind s_Default
Partial Class s_Default
Inherits System.Web.UI.Page
Sub Page_Load() Handles Me.Load
username.Text = Session("UserRole").ToString()
End Sub
Protected Sub rbl_C112_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles rbl_C112.SelectedIndexChanged
l_c112.Text = ""
l_c112.Text = rbl_C112.SelectedItem.ToString()
End Sub
End Class