2016-09-26 22 views
-1

我使用C#在Web窗體中創建了一個簡單的郵資計算器(我知道,我知道,我們必須在類中使用Web窗體)。我在造型時使用了一些Bootstrap,並且在某個時候,我的RadioButtonList停止工作。沒有一個單選按鈕可以選擇。不確定是什麼原因造成的。爲什麼我的單選按鈕列表不再工作? (使用CSS設計樣式後)

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="PostageCalculator._default" %> 

<!DOCTYPE html> 

<html xmlns="http://www.w3.org/1999/xhtml"> 

<head runat="server"> 
    <meta charset="utf-8" /> 

    <meta name="viewport" content="width=device-width, initial-scale=1"/> 

    <link href="Content/bootstrap.min.css" rel="stylesheet" /> 
    <script src="scripts/bootstrap.min.js"></script> 
    <link href="Content/bootstrap-theme.min.css" rel="stylesheet" /> 

    <title></title> 
    <style type="text/css"> 
     .auto-style1 { 
      width: 249px; 
      height: 250px; 


     } 

     #boxiediv { 
      text-align: center; 
      position: absolute; 
      top: 0; 
      bottom: 0; 
      left: 0; 
      right: 0; 
      margin: auto; 
     } 
.outer-div 
{ 
    padding: 30px; 
    text-align: center; 
} 
.inner-div 
{ 
    display: inline-block; 
    padding: 50px; 
} 






    </style> 
</head> 
<body> 
    <form id="form1" runat="server" autocomplete="off"> 
     <div class="page-header"> 
     <div class="container-fluid"> 



      <div id="boxiediv" > <img id="boxielogo" alt="Boxie. Easier than it should be." class="auto-style1" src="boxielogo2.png" align="middle"/></div> 

      <br /><br /><br /> <br /><br /><br /><br /><br /><br /> <br /><br /><br /> 

     <div style="background-color: #4d6684 !important; " class="jumbotron outer-div" id="jbotron1" > 

     <div id="textboxes" class="row" > 

      <div class="col-md-4"> 

     <asp:TextBox ID="widthTextBox" value="0" type="number" AutoPostBack="true" runat="server" OnTextChanged="Calculate"></asp:TextBox> 
       <em>&nbsp;width</em></div> 

       <div class="col-md-4"> 
     <asp:TextBox ID="heightTextBox" value="0" type="number" AutoPostBack="true" runat="server" OnTextChanged="Calculate"></asp:TextBox> 
        <em>&nbsp; height</em> 
       </div> 

       <div class="col-md-4"> 
     <asp:TextBox ID="lengthTextBox" value="0" type="number" AutoPostBack="true" runat="server" OnTextChanged="Calculate"></asp:TextBox> 
        <em>&nbsp; length (optional)</em></div> 
       <br /> 

     </div><!--Closing tag for #textboxes--> 

      <div id="radiolist" class="inner-div" > 

       <asp:RadioButtonList AutoPostBack="true" ID="deliveryRadioList" runat="server" OnSelectedIndexChanged="Calculate" 
       RepeatDirection="Horizontal" > 

       <asp:ListItem Value="0.15" style="margin-right: 20px">Ground</asp:ListItem> 
      <asp:ListItem Value="0.25" style="margin-right: 20px">Air</asp:ListItem> 
       <asp:ListItem Value="0.45" >Next Day</asp:ListItem> 

     </asp:RadioButtonList> 



       </div><!-- closing tag for #radios--> 
     <asp:HiddenField ID="cost" runat="server" Value="0" /> 
     <asp:Label ID="resultLabel" runat="server"></asp:Label> 
     </div> 
    </div> 
     </div> 
    </form> 
</body> 
</html> 
+2

問題尋求幫助調試(「爲什麼不是這個代碼的工作?」)必須包括所期望的行爲,一個特定的問題或錯誤,並在最短的代碼有必要在問題本身中重現它。沒有明確問題陳述的問題對其他讀者無益。請參閱:如何創建最小,完整和可驗證示例。 – mybirthname

+0

請正確縮進 – Flint

回答

0

與ID boxiediv的div覆蓋整個頁面的外觀,它阻止了其他組件。我敢打賭,如果你評論這個div,你的單選按鈕將會起作用。

我不確定你希望它看起來如何,你可能需要使用z-index將它移到後面或者可能與高度一起玩耍。

#boxiediv { 的z-index:-1 }

相關問題