2012-11-08 90 views
0

我有一個表格製成的divs。 Theere是一個主表格,然後div用作表格單元格和表格行。在單元格內有一個標籤和一個文本框。所有的都是Asp.Net控件(文本框,標籤)。一切似乎都出現在瀏覽器中,除了一個特定的列,我不知道爲什麼。 「孃家姓名」一欄不會顯示。Asp.Net控件裏面的div沒有顯示在瀏覽器中

代碼:

<div class="block"> 
      <div class="line"> 

       <div class="labelcell"> 
        <asp:Label ID="lblPersonLastName" runat="server" Text="Last Name: " meta:resourcekey="lblPersonLastNameResource1"/> 
       </div> 
       <div class="cell"> 
        <asp:TextBox ID="txtPersonLastName" runat="server" MaxLength="200" Width="120px" meta:resourcekey="txtPersonLastNameResource1"/> 
       </div> 


       <div class="labelcell"> 
        <asp:Label ID="lblPersonDateOfBirth" runat="server" Text="Date of Birth:" meta:resourcekey="lblPersonDateOfBirthResource1"/> 
       </div> 
       <div class="cell"> 
        <asp:TextBox ID="txtPersonDateOfBirth" runat="server" MaxLength="20" Width="120px" meta:resourcekey="txtPersonDateOfBirthResource1"/> 
        <asp:RegularExpressionValidator ID="regValDate" runat="server" ControlToValidate="txtPersonDateOfBirth" ErrorMessage="Date format must be YYYY/MM/DD or YYYY-MM-DD" ValidationExpression="(^[0-9]{4,4}(/|-)[0-1][0-9](/|-)[0-3][0-9]$)" ValidationGroup="AddPerson" meta:resourcekey="regValDateResource1">*</asp:RegularExpressionValidator> 
       </div> 

      </div> 

      <div class="line"> 
       <div class="labelcell"> 
        <asp:Label ID="lblPersonFirstName" runat="server" Text="First Name: " meta:resourcekey="lblPersonFirstNameResource1"/> 
       </div> 
       <div class="cell">  
        <asp:TextBox ID="txtPersonFirstName" runat="server" MaxLength="200" Width="120px" meta:resourcekey="txtPersonFirstNameResource1"/> 
       </div> 

       <div class="labelcell"> 
        <asp:Label ID="lblPersonAgeRange" runat="server" Text="Age Between:" meta:resourcekey="lblPersonAgeRangeResource1"/> 
       </div> 
       <div class="cell"> 
        <asp:TextBox ID="txtPersonAgeRangeLow" runat="server" Width="30px" meta:resourcekey="txtPersonAgeRangeLowResource1"/> 
        &nbsp;<asp:Label ID="lblPersonAgeRangeAnd" runat="server" Text="and" Height="25px" meta:resourcekey="lblPersonAgeRangeAndResource1"/>&nbsp; 
        <asp:TextBox ID="txtPersonAgeRangeHigh" runat="server" Width="30px" meta:resourcekey="txtPersonAgeRangeHighResource1" /> 
       </div> 
      </div> 


      <div class="line"> 
       <div class="labelcell"> 
        <asp:Label ID="lblPersonMiddleName" runat="server" Text="Middle Name: " meta:resourcekey="lblPersonMiddleNameResource1"/> 
       </div> 
       <div class="cell"> 
        <asp:TextBox ID="txtPersonMiddleName" runat="server" MaxLength="128" Width="120px" meta:resourcekey="txtPersonMiddleNameResource1"/> 
       </div> 
       <div class="labelcell"> 
        <asp:Label ID="lblPersonSex" runat="server" Text="Sex:" meta:resourcekey="lblPersonSexResource1"/> 
       </div> 
       <div class="cell"> 
        <asp:RadioButton ID="rdbPersonSexMale" runat="server" AutoPostBack="True" OnDataBinding="SexChange" OnCheckedChanged="SexChange" GroupName="PersonSex" Text="Male " meta:resourcekey="rdbPersonSexMaleResource1"/> 
        <asp:RadioButton ID="rdbPersonSexFemale" runat="server" AutoPostBack="True" OnDataBinding="SexChange" OnCheckedChanged="SexChange" GroupName="PersonSex" Text="Female " meta:resourcekey="rdbPersonSexFemaleResource1" /> 
       </div> 
      </div> 

      <div class="line"> 

      <div class="labelcell"> 
       <asp:Label ID="lblPersonStatus" runat="server" Text="Status:" meta:resourcekey="lblPersonStatusResource1"/> 
       </div> 
       <div class="cell"> 
       <asp:DropDownList ID="ddlPersonStatus" runat="server" AppendDataBoundItems="True" DataSourceID="dsPersonStatus" DataTextField="Status" DataValueField="StatusID" OnPreRender="ddlPersonStatus_PreRender" Width="120px" meta:resourcekey="ddlPersonStatusResource1"> 
        <asp:ListItem Value="-1" meta:resourcekey="ListItemResource2">--Select--</asp:ListItem> 
       </asp:DropDownList> 
      </div> 
       <div class="labelcell"> 
        <asp:Label ID="lblPersonMaidenName" runat="server" Text="Maiden Name:" meta:resourcekey="lblPersonMaidenNameResource1"/> 
       </div> 
       <div class="cell"> 
        <asp:TextBox ID="txtPersonMaidenName" runat="server" MaxLength="200" Width="120px" meta:resourcekey="txtPersonMaidenNameResource1"/> 
       </div> 

      </div> 

      <div class="line"> 
       <div class="labelcell"> 
        <asp:Label ID="lblPersonThirdName" runat="server" Text="Third Name: " meta:resourcekey="lblPersonThirdNameResource1"/> 
       </div> 
       <div class="cell"> 
        <asp:TextBox ID="txtPersonThirdName" runat="server" MaxLength="128" Width="120px" meta:resourcekey="txtPersonThirdNameResource1"/> 
       </div> 
       <div class="labelcell"> 
        <asp:Label ID="lblPersonFps" runat="server" Text="FPS: " meta:resourcekey="lblPersonFpsResource1"/> 
       </div> 
       <div class="cell"> 
        <asp:TextBox ID="txtPersonFps" runat="server" MaxLength="200" Width="120px" meta:resourcekey="txtPersonFpsResource1"/> 
       </div> 
      </div> 
      <div class="line"> 
       <div class="labelcell"> 
        <asp:Label ID="lblPersonForthName" runat="server" Text="Fourth Name: " meta:resourcekey="lblPersonForthNameResource1"/> 
       </div> 
       <div class="cell"> 
        <asp:TextBox ID="txtPersonForthName" runat="server" MaxLength="128" Width="120px" meta:resourcekey="txtPersonForthNameResource1"/> 
       </div> 
       <div class="labelcell"> 
        <asp:Label ID="lblPersonEthnicity" runat="server" Text="Ethnicity:" meta:resourcekey="lblPersonEthnicityResource1"/> 
       </div> 
       <div class="cell"> 
        <asp:DropDownList ID="ddlPersonEthnicity" Width="120px" runat="server" AppendDataBoundItems="True" DataSourceID="dsPersonEthnicity" DataTextField="Ethnicity" DataValueField="EthnicityID" OnPreRender="ddlPersonEthnicity_PreRender" meta:resourcekey="ddlPersonEthnicityResource1"> 
         <asp:ListItem Value="-1" meta:resourcekey="ListItemResource1">--Select--</asp:ListItem> 
        </asp:DropDownList> 
       </div> 

      </div> 
     </div> 

這部分似乎沒有也不會在瀏覽器中顯示:

   <div class="labelcell"> 
        <asp:Label ID="lblPersonMaidenName" runat="server" Text="Maiden Name:" meta:resourcekey="lblPersonMaidenNameResource1"/> 
       </div> 
       <div class="cell"> 
        <asp:TextBox ID="txtPersonMaidenName" runat="server" MaxLength="200" Width="120px" meta:resourcekey="txtPersonMaidenNameResource1"/> 
       </div> 

如何在HTML中顯示出來(孃家姓部分):

<div class="labelcell"></div> 

<div class="cell"></div> 

以下是確實出現的「線條」:

<div class="line"> 
       <div class="labelcell"> 
        <span id="lblPersonThirdName">Third Name: </span> 
       </div> 
       <div class="cell"> 
        <input name="txtPersonThirdName" type="text" maxlength="128" id="txtPersonThirdName" style="width:120px;"> 
       </div> 
       <div class="labelcell"> 
        <span id="lblPersonFps">FPS: </span> 
       </div> 
       <div class="cell"> 
        <input name="txtPersonFps" type="text" maxlength="200" id="txtPersonFps" style="width:120px;"> 
       </div> 
      </div> 
+0

這裏的代碼沒有顯示任何原因,也許如果你有它的生活。 – Aristos

+0

嗯,我只是把代碼放在那裏,以防有人要求看到它。這讓我非常困惑。所有其他控件顯示除了一行之外。 – john

+0

如果你可以發佈在瀏覽器中呈現的內容,會給我們一些線索嗎? – Tariqulazam

回答

0

將Visible屬性設置爲false的ASP.NET服務器控件不呈現給頁面html。確保在頁面呈現之前控件lblPersonMaidenName和txtPersonMaidenName是可見的。

相關問題