我的ModalPopupExtender存在问题。我在ModalPopupExtender中添加了一个标签,并尝试将label与数据库中的值绑定。当我调试时,该值显示在标签的文本上(即没有数据库错误),但是在显示弹出窗口时它没有显示。
任何人都可以帮我吗?????????
这是我的代码
<asp:Panel ID="PopupPnl" runat="server">
<table style="width:100%;">
<tr>
<td >
<asp:Label ID="Label2" runat="server"
Text="View Description" >
</asp:Label>
</td>
</tr>
<tr>
<td >
<asp:Label ID="label_Descrption" runat="server" >
</asp:Label>
</td>
</tr>
<tr style="background-color:White;">
<td >
<asp:Button ID="btnExit" runat="server" Text="Exit"/>
</td>
</tr>
</table>
</asp:Panel>
<asp:Button ID="btnShowPopup" runat="server"
style="display:none;"/>
<cc1:ModalPopupExtender ID="ModalPopupExtender2" runat="server"
TargetControlID="btnShowPopup"
PopupControlID="PopupPnl"
CancelControlID="btnExit"
BackgroundCssClass="ModalPopupBG" >
</cc1:ModalPopupExtender>
protected void lbn_Template_Click(object sender, EventArgs e)
{
util_Category objUtilCategory = new util_Category();
cl_Category objClCategory = new cl_Category();
if (ddlSubCategory.SelectedItem.Text != "--Select A SubCategory--")
{
objClCategory.CategoryId = Convert.ToInt32(ddlSubCategory.SelectedValue);
Label lbl = (Label)PopupPnl.FindControl("label_Descrption");
label_Descrption.Text = objUtilCategory.GetATemplate(objClCategory);
ModalPopupExtender2.Show();
}
}
答案 0 :(得分:1)
您需要将包含Panel
的{{1}}放在label_Description
内。