在選擇任何觸發後備我的單選按鈕列表選擇goto Index 0的單選按鈕或表單事件時,其他表單項目均不受影響。我禁用了主列表重定向代碼,除了下拉列表,單選按鈕列表和標籤以外,我還創建了一個全新的頁面,其中沒有任何內容可以查看選定的數據。我很難過。RadiobuttonList回傳到索引0
有沒有建議嗎?我只是希望它保持selectedindex,並允許我填寫post backs之間的正確值。
<%@ 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代碼隱藏s_默認
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
好的,我看到我的錯誤。我會盡快嘗試。謝謝! – new2asp