0

Webアプリケーションの開発にVS2010を使用しています。「管理者」が会社を承認した後、メッセージボックスに「ベンダー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 に答える