最佳解答者
ModalPopupExtender SHOW後的問題.

問題
-
當ModalPopupExtender1 .show 後, 自己在 gridview 加入的style 不見了. 例如我在 PagerTemplate 加上的文字和 css 都消失了.,
請問為甚麼會這樣的 ?
例如加入 "Page no:" 在 DataControlRowType.Pager
當按下button顯示ModelPopup後, "Page No:" 就不見了.
Code如下
Protected Sub gdvLawList_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles gdvLawList.RowDataBound
If e.Row.RowType = DataControlRowType.Pager Then
Dim pagerCell As TableCell
pagerCell = CType(e.Row.Controls(0), TableCell)
'pagerCell.Controls.Clear()
Dim txt As String
Dim txtGoPage As StringtxtGoPage = "Page No: "
txt = "<font size='2pt'>" & txtGoPage & " </font><span class=i>"
pagerCell.Controls.AddAt(0, New LiteralControl(txt))pagerCell.Controls.AddAt(pagerCell.Controls.Count, New LiteralControl("</span>"))
2009年3月22日 上午 11:02
解答
-
LAM0706 你好
我都認同 FEFANG 的說法應該是 UPDATE PANEL 的問題
我之前都有差不多的問題
你可不可以改你的MODAL POPUP CODE 入去UPDATE PANEL 事事看
或者在 gdvLawList_RowDataBound 入面改一些CODE 令佢 常常都 GENERATE PAGER?
Please forgive me if my concept is wrong
Hope this can help.
Chi- 已標示為解答 KeFang Chen 2009年3月27日 上午 08:25
- 已取消標示為解答 KeFang Chen 2009年3月27日 上午 08:26
- 已標示為解答 KeFang Chen 2009年3月27日 上午 08:27
2009年3月25日 上午 06:22
所有回覆
-
我的Code
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<div id="dlg" class="panel" style="width:963px">
<div class="header" style="cursor:default">
<div class="outer">
<div class="inner">
<div class="content">
<h2>Export to Excel</h2>
</div>
</div>
</div>
</div>
<div class="body">
<div class="outer">
<div class="inner">
<div class="content">
<asp:GridView ID="gdvList" runat="server" AllowPaging="True" AutoGenerateColumns="False"
ForeColor="Black" CssClass="datatable" CellPadding="0" BorderWidth="0px" GridLines="None"
Width="950px" Font-Size="10pt" PageSize="10" AllowSorting="False">
<Columns>
<asp:TemplateField HeaderText="編輯" Visible="false">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" Width="15px"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Roles" Visible="false">
<HeaderTemplate>
<asp:CheckBox ID="chkAll" onclick="javascript:SelectAllCheckboxesSpecific(this);"
runat="server" />
</HeaderTemplate>
<ItemTemplate>
<asp:Label ID="hdnID" Text='<%# SwitchColumnLang(DataBinder.Eval(Container.DataItem, "SeqId_ch") , DataBinder.Eval(Container.DataItem, "SeqId_pt")) %>'
runat="server" Visible="False">
</asp:Label>
<asp:CheckBox onclick="javascript:HighlightRow(this);" ID="ChkSelection" runat="server" />
</ItemTemplate>
<HeaderStyle />
<ItemStyle HorizontalAlign="Center" Width="20px"></ItemStyle>
</asp:TemplateField>
<asp:TemplateField HeaderText="Doc">
<HeaderTemplate>
</HeaderTemplate>
<ItemTemplate>
<asp:ImageButton ID="btnSetIframeLink" runat="server" ImageUrl="~/Images/doc.gif" OnClick="SetIframeLink" CommandName="SetIframeLink" CommandArgument='<%# Eval("SeqId_ch") %>'/>
<asp:ImageButton ID="btnOpenDocLink" runat="server" ImageUrl="~/Images/doc.gif" OnClick="OpenDocLink" CommandName="OpenDocLink" CommandArgument='<%# Eval("SeqId_ch") %>'/>
</ItemTemplate>
<HeaderStyle />
<ItemStyle HorizontalAlign="Center" Width="20px"></ItemStyle>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#CCCC99" />
<PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
<HeaderStyle VerticalAlign="Middle" HorizontalAlign="Center" Height="20px" />
<PagerSettings Mode="Numeric" />
<RowStyle VerticalAlign="Top" CssClass="row" Height="50pt" />
</asp:GridView>
</div>
</div>
</div>
</div>
<div class="footer">
<div class="outer">
<div class="inner">
<div class="content"></div>
</div>
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Panel ID="DocPanel" runat="server" Style="display: none;"
Width="900px" Height="600">
<div class="footer" style="text-align: left">
</div>
<div class="footer" style="text-align: right">
<asp:ImageButton ID="btnClose" runat="server" AlternateText="Close" ImageUrl="~/Images/CloseX.png"
CausesValidation="false" Width="38px" Height="38px" />
</div>
<asp:Button ID="btnShowPopup" runat="server" Style="display: none" />
<iframe id="DocFrame" width="900px" height="550" src=""></iframe>
</asp:Panel>
<asp:ImageButton ID="btnTMP" runat="server" ImageUrl="~/Images/doc.gif" OnClientClick="download('http://www.abc.com')" /><cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" PopupControlID="DocPanel"
BackgroundCssClass="modalBackground" TargetControlID="btnTMP" CancelControlID="btnClose">
</cc1:ModalPopupExtender>2009年3月25日 上午 04:33 -
楼主,你好
我这边看不出哪里有问题。
感觉你的UpdatePanel在你贴出来的代码中无效。你去掉试试。
Microsoft Online Community Support- 已標示為解答 KeFang Chen 2009年3月27日 上午 08:25
- 已取消標示為解答 KeFang Chen 2009年3月27日 上午 08:25
2009年3月25日 上午 05:59 -
LAM0706 你好
我都認同 FEFANG 的說法應該是 UPDATE PANEL 的問題
我之前都有差不多的問題
你可不可以改你的MODAL POPUP CODE 入去UPDATE PANEL 事事看
或者在 gdvLawList_RowDataBound 入面改一些CODE 令佢 常常都 GENERATE PAGER?
Please forgive me if my concept is wrong
Hope this can help.
Chi- 已標示為解答 KeFang Chen 2009年3月27日 上午 08:25
- 已取消標示為解答 KeFang Chen 2009年3月27日 上午 08:26
- 已標示為解答 KeFang Chen 2009年3月27日 上午 08:27
2009年3月25日 上午 06:22