我的頁面中有一個modalpopupextender
。該模式在gridview
。它工作正常,唯一的問題是它的寬度在屏幕的90%左右。我不想硬編碼width
(這有效),因爲由於文本長度可以改變,它可能會離開面板,這不是很好看。Ajax ModalPopup寬度問題
<div runat="server">
<asp:ModalPopupExtender ID="ModalPopupInfo" runat="server"
CancelControlID="btnClose" OnCancelScript="HideModalPopup()"
TargetControlID="lbName" PopupControlID="pnlInfo" Drag="True"
BackgroundCssClass="ModalPopupBg" DynamicServicePath="" Enabled="True"/>
</div>
<asp:LinkButton ID="lbName" runat="server" ></asp:LinkButton>
<div style="width:inherit;">
<asp:Panel ID="pnlInfo" runat="server" Font-Names="Times New Roman" UpdateMode="Conditional" EnableViewState="true" style="display:none; background-color:#FFFFFF; padding:20px; margin:50px; border:3px solid #4B0303; color:Black; width:auto;" >
<div runat="server" class="divTable" style="width:inherit;">
<div runat="server" class="divRow" style="text-align:center; width:300px; float:left;">
<asp:UpdatePanel ID="pnlImage" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Accordion ID="Accordion" runat="server" FadeTransitions="true" FramesPerSecond="40" TransitionDuration="250" AutoSize="None" SelectedIndex="-1" RequireOpenedPane="false" SuppressHeaderPostbacks="true" Height="50px" Width="360px" Enabled= "false">
<Panes>
<asp:AccordionPane ID="AccordionPane" runat="server">
<Header>
<asp:Image ID="imgUser" runat="server" ImageAlign="Middle" Width="100px" Height="100px" EnableViewState="true"/>
<asp:Label ID="lblUsrCode" runat="server" Visible="false" Text='<%# Eval("usr_cd") %>'></asp:Label>
</Header>
<Content>
<asp:AsyncFileUpload ID="AsyncFileUpload" runat="server" OnUploadedComplete="OnUpdateComplete" />
</Content>
</asp:AccordionPane>
</Panes>
</asp:Accordion>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="lbUpdate" EventName="Click"/>
</Triggers>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" UpdateMode="Always">
<ContentTemplate>
<asp:LinkButton ID="lbUpdate" runat="server" Visible="false" OnClick="lbUpdate_Click" OnClientClick="__doPostBack('pnlImage', '');"/>
</ContentTemplate>
</asp:UpdatePanel>
</div><br /><br />
</asp:Panel>
</div>
有一個在ASP面板更多的代碼,但由於它只是更divs
和linkbuttons
它是不是這個問題很重要。
我試着把寬度繼承和自動,但它沒有效果。我試圖在模式彈出窗口的div中添加一個值,但是在gridview
列的寬度中產生了問題,所以我排除了這個選項。我認爲我將寬度設置爲auto或某些東西的方式可能有問題,但我無法找到它。
而且,我使用IE7(公司限制)