Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net Modal Popup Extender:从数据库获取数据,然后将其绑定到ModalPopupXtender中的标签_Asp.net_Modalpopupextender - Fatal编程技术网

Asp.net Modal Popup Extender:从数据库获取数据,然后将其绑定到ModalPopupXtender中的标签

Asp.net Modal Popup Extender:从数据库获取数据,然后将其绑定到ModalPopupXtender中的标签,asp.net,modalpopupextender,Asp.net,Modalpopupextender,我对ModalPopupXtender有问题。我在ModalPopupXtender中放置了一个标签,并尝试将标签和数据库中的值绑定。调试时,该值显示在标签文本上(即没有数据库错误),但在弹出窗口显示时不显示 谁能帮我一下吗 这是我的密码 html上的代码 您需要将包含标签描述的面板放置在UpdatePanel内,如何绑定标签?标签的绑定容器(DetailView、GridView、Repeater)在弹出窗口的内部还是外部?数据是在显示弹出窗口之前还是之后绑定的?您如何打开弹出窗口(服务器/客

我对ModalPopupXtender有问题。我在ModalPopupXtender中放置了一个标签,并尝试将标签和数据库中的值绑定。调试时,该值显示在标签文本上(即没有数据库错误),但在弹出窗口显示时不显示

谁能帮我一下吗

这是我的密码

html上的代码
您需要将包含标签描述的
面板
放置在
UpdatePanel
内,如何绑定标签?标签的绑定容器(DetailView、GridView、Repeater)在弹出窗口的内部还是外部?数据是在显示弹出窗口之前还是之后绑定的?您如何打开弹出窗口(服务器/客户端)?请提供一些代码。我已经按照您的建议发布了代码。请仔细阅读。你好,Waqas先生,它的工作很好,非常感谢。如果您不介意,可以告诉我为什么面板被放置在更新面板中。实际上,UpdatePanel为您提供了刷新部分页面的功能,因此,可以更新UpdatePanel中的内容,而无需更新或支持整个页面。。有关更多详细信息,请参阅:。。。
<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();
    }
}