Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
148 views
in Technique[技术] by (71.8m points)

c# - Panel cover the rest control when setted display:block

The code below seems to be so long, but it's not hard to understand what I did in that code. Hope you can give me a solution.

I have a panel ID="ASPxPanel2" with stype set to display:none.

After I click on button New --> the panel will be displayed.

When I set the ASPxPanel2 display:block as default, the Panel1 will be displays below the Panel2. But when I set Panel2 display:none and then set it display:block again in code behind---> the Panel2 display cover Panel1.

    <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

    <table>
    <tr>
    <td>
    <dx:ASPxPanel ID="ASPxPanel2" runat="server" Width="700px" Height="150px"  RenderMode="Table"  CssClass="display_none">//set to display:none here
    <PanelCollection>
    <dx:PanelContent ID="PanelContent1" runat="server" SupportsDisabledAttribute="True">
    <table>
    <tr>
    <td colspan=4>
        <asp:Label ID="LabelError" runat="server" ForeColor="red" Text="">
         </asp:Label>
    </td
    </tr>
    <tr>
    <td>??i t??ng</td>
    <td>
        <dx:ASPxComboBox ID="MA_DOI_TUONG" runat="server" ClientIDMode="AutoID" 
            ValueType="System.String">
        </dx:ASPxComboBox>
    </td>
    <td>Lo?i</td>
    <td >
           <dx:ASPxComboBox ID="MA_LOAI" runat="server" ClientIDMode="AutoID" 
            ValueType="System.String">
        </dx:ASPxComboBox> 
    </td>
    <td class="style6">
    &nbsp;</td>
    <td rowspan=5>
        MoreFileUpload
                        <div style="display: "";" id="div0">
                        <dx:ASPxTextBox ID="TFileUpload0" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>
                        <asp:FileUpload ID="FileUpload0" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>

                        <div style="display: none;" id="div1">
                        <dx:ASPxTextBox ID="TFileUpload1" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>                    
                        <asp:FileUpload ID="FileUpload1" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>

                        <div style="display: none;" id="div2">
                        <dx:ASPxTextBox ID="TFileUpload2" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>
                        <asp:FileUpload ID="FileUpload2" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>   

                         <div style="display: none;" id="div3">
                        <dx:ASPxTextBox ID="TFileUpload3" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>                    
                        <asp:FileUpload ID="FileUpload3" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>

                        <div style="display: none;" id="div4">
                        <dx:ASPxTextBox ID="TFileUpload4" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>
                        <asp:FileUpload ID="FileUpload4" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>
                        <div style="display: none;" id="div5">
                        <dx:ASPxTextBox ID="TFileUpload5" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>                    
                        <asp:FileUpload ID="FileUpload5" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>

                        <div style="display: none;" id="div6">
                        <dx:ASPxTextBox ID="TFileUpload6" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>
                        <asp:FileUpload ID="FileUpload6" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>
                        <div style="display: none;" id="div7">
                        <dx:ASPxTextBox ID="TFileUpload7" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>                    
                        <asp:FileUpload ID="FileUpload7" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>

                        <div style="display: none;" id="div8">
                        <dx:ASPxTextBox ID="TFileUpload8" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>
                        <asp:FileUpload ID="FileUpload8" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>
                        <div style="display: none;" id="div9">
                        <dx:ASPxTextBox ID="TFileUpload9" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>                    
                        <asp:FileUpload ID="FileUpload9" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>

                        <div style="display: none;" id="div10">
                        <dx:ASPxTextBox ID="TFileUpload10" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>
                        <asp:FileUpload ID="FileUpload10" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>
                        <div style="display: none;" id="div11">
                        <dx:ASPxTextBox ID="TFileUpload11" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>                    
                        <asp:FileUpload ID="FileUpload11" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>

                        <div style="display: none;" id="div12">
                        <dx:ASPxTextBox ID="TFileUpload12" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>
                        <asp:FileUpload ID="FileUpload12" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>
                        <div style="display: none;" id="div13">
                        <dx:ASPxTextBox ID="TFileUpload13" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>                    
                        <asp:FileUpload ID="FileUpload13" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>

                        <div style="display: none;" id="div14">
                        <dx:ASPxTextBox ID="TFileUpload14" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>
                        <asp:FileUpload ID="FileUpload14" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>
                        <div style="display: none;" id="div15">
                        <dx:ASPxTextBox ID="TFileUpload15" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>                    
                        <asp:FileUpload ID="FileUpload15" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>

                        <div style="display: none;" id="div16">
                        <dx:ASPxTextBox ID="TFileUpload16" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>
                        <asp:FileUpload ID="FileUpload16" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>
                        <div style="display: none;" id="div17">
                        <dx:ASPxTextBox ID="TFileUpload17" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>                    
                        <asp:FileUpload ID="FileUpload17" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>

                        <div style="display: none;" id="div18">
                        <dx:ASPxTextBox ID="TFileUpload18" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>
                        <asp:FileUpload ID="FileUpload18" runat="server" accept="png|jpg" Width="180px" size=32 />
                        </div>
                        <div style="display: none;" id="div19">
                        <dx:ASPxTextBox ID="TFileUpload19" runat="server" ClientIDMode="AutoID" 
                                Width="180px" Height="16px">
                        </dx:ASPxTextBox>
                        <asp:FileUpload ID="FileUpload19" runat="server" accept="png|jpg" Width="180px" size=27 />
                        </div>
                        <div style="text-align: left; width: 263px;" id="divShow">
                            <a id="linkMore" href="javascript:void(0)" onclick="javascript:ShowHideFileUpload(this.id)">
                                + Add More ...</a></div>

                        <br /><br />
    </td>
    </tr>
    <tr>
    <td>Title</td>
    <td class="style5" colspan=3>
        <dx:ASPxTextBox ID="TITLE" runat="server" ClientIDMode="AutoID" 
            Width="300px" Height="16px" >
        </dx:ASPxTextBox>
    </td>
    </tr>
    <tr><td>Content</td>
    <td class="style2" colspan=3>
           <FTB:FreeTextBox id="ftCONTENT" runat="server"
           ToolbarLayout="ParagraphMenu,FontFacesMenu,FontSizesMenu,FontForeColorsMenu,FontForeColorPicker,FontBackColorsMenu,FontBackColorPicker|Bold,Italic,Underline,JustifyLeft,JustifyRight,JustifyCenter,JustifyFull;BulletedList,Numb

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You have broken tags. This part:

 </dx:aspxpanel>
            </td>
        </tr>
        </dx:ASPxPanel>
</td>
</tr>
    </table>
    </asp:Panel>  //end ASPXPanel2 

Should be:

                </dx:aspxpanel>
            </td>
        </tr>
    </table>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...