0

我正在使用 VS 2010 开发 Web 应用程序。在“管理员”批准公司后,消息框必须显示“供应商 ID:lblPage2ID 修改为“已批准”(或“未批准”或“待定”的消息") 在“管理员”选择的单选按钮上。怎么做?请参考下面的内联代码并告诉我如何将单选按钮放置在直线上。

   protected void rblTest_SelectedIndexChanged(object sender,EventArgs e)
    {
     _DAL.ExecuteSQL("UPDATE Company_Info SET 
          Approval_Status='"+rblTest.SelectedValue+"' WHERE Vendor_ID= '" +lblPage2ID.Text +"'");
          ClientScript.RegisterStartupScript(this.GetType(),"callfunction",
        "alert('Approval Status modified in database');", true);
      //  Page.ClientScript.RegisterClientScriptBlock (typeof(Page),"SCRIPT",
         string.Format("alert(Approval Status modified as '" +rblTest.SelectedValue+"')"), true);
      //  HttpContext.Current.Response.Write("<script>alert (Approval Status modified as 
         '" + rblTest.SelectedValue +"');</script>");
      //  ClientScript.RegisterStartupScript (this.GetType ), "callfunction", 
            "alert('Approval Status modified as '"+rblTest.SelectedValue+"');",true);
    }

    <asp:RadioButtonList ID="rblTest" align = "center" runat="server" AutoPostBack="true"   Width="152px" onselectedindexchanged="rblTest_SelectedIndexChanged" style="margin-left: 0px"> 
            <asp:ListItem  Text="Approved" Value="YES"></asp:ListItem> 
            <asp:ListItem  Text="Not Approved" Value="NO"></asp:ListItem> 
            <asp:ListItem  Text="Pending" Value="PEN"></asp:ListItem> 
     </asp:RadioButtonList>

单选按钮

4

1 回答 1

0
Set the RepeatDirection property of the RadioButtonList control to horizontal.

<asp:RadioButtonList ID="rblTest" align = "center" runat="server" RepeatDirection="Horizontal" AutoPostBack="true"   Width="152px" onselectedindexchanged="rblTest_SelectedIndexChanged" style="margin-left: 0px"> 
            <asp:ListItem  Text="Approved" Value="YES"></asp:ListItem> 
            <asp:ListItem  Text="Not Approved" Value="NO"></asp:ListItem> 
            <asp:ListItem  Text="Pending" Value="PEN"></asp:ListItem> 
</asp:RadioButtonList>
于 2013-01-18T22:28:00.477 回答