我有一個ASP面板,附帶一個modalpopupextender,它是動態顯示的。在面板中,有兩個標籤在顯示面板彈出窗口時動態填充文本。然而,當它顯示標籤是空白的(缺失)。下面是我的HTML標記和代碼隱藏代碼:ASP.Net:面板中的標籤控制不更新
HTML標記
<asp:Panel ID="pnlalert" runat="server" CssClass="modal">
<div class="rel">
<div class="modal-inner-wrapper-alert rounded-corners">
<div class="content rounded-corners">
<div class="body">
<div class="popuppanel">
<div class="popupGnrl-Alert">
<asp:Label ID="alerttitle" runat="server" Text=""></asp:Label><br />
<asp:Label ID="alertlabel" runat="server" Text=""></asp:Label>
<asp:HiddenField ID="section" runat="server" />
<asp:HiddenField ID="violation" runat="server" />
</div>
<div class="popupGnrl-Alert" style="text-align:center;">
<asp:Button ID="cmdMaxAlertOk" runat="server" Text="Yes" Width="50px"
onclick="cmdMaxAlertOk_Click" /> <asp:Button ID="cmdMaxAlertCancel"
runat="server" Text="No" Width="50px" onclick="cmdMaxAlertCancel_Click" />
</div>
</div>
</div>
</div>
</div>
</div>
</asp:Panel>
<asp:ModalPopupExtender ID="mpealert" runat="server" TargetControlID="popuplnk" PopupControlID="pnlalert" >
</asp:ModalPopupExtender>
ASP.NET代碼
this.mpealert.Show();
this.alerttitle.Text = "Submission time exceeded";
this.alertlabel.Text = "This expense was incurred greater than 3 months ago and is therefore outside of the normal claim period. Do you still wish to proceed? NOTE: expense may be rejected by Finance.";
什麼引起的標籤不顯示的背後?
你嘗試設置文本,然後調用'Show()'? –
是的,我剛剛嘗試過,但我沒有得到您的意見,但它仍然沒有工作 – mattgcon