列表视图中的Modalpopup Extender不包含值 [英] Modalpopup Extender in the listview does not carry values

查看:72
本文介绍了列表视图中的Modalpopup Extender不包含值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在编辑链接"按钮上,它会触发命令,但无法写入" this.ModalPopupExtenderQ.show();",因为此处无法访问它.

我想在Modalpopup中编辑实际面板"的内容,如何将实际面板的标签值分配给弹出面板的文本框?
请帮忙

on Edit Linkbutton it fires the command but cant write " this.ModalPopupExtenderQ.show();" because its un accessible here.

I want to edit the contents of "actual panel" in Modalpopup how can i assign the values of the labels of actual panel to the textboxes of Popup Panel???

Please Helppp

<asp:ListView runat="server" ID="ListViewQualification" InsertItemPosition="LastItem" 

            onitemcommand="ListView1_ItemCommand"> 
<layouttemplate>
 
   
  <asp:Panel id="itemPlaceholder" runat="server"/>
  
</layouttemplate>
<itemtemplate>

<asp:Panel runat="server" ID="actual" class="panel">
<asp:LinkButton ID="imgbtn" runat="server" CssClass="panel"  CommandName="Edit">Edit
<%--<asp:LinkButton ID="lnkEdit" runat="server" Text="Edit">--%>
  <asp:Label runat="server" ID="lblId" Visible="false"><%#Eval("InstituteID")%>
   <asp:Label runat="server" ID="lblStartYr"><%#Eval("YearStart")%>
   <asp:Label runat="server" ID="lblEndYr"><%#Eval("YearEnd")%>
   <asp:HyperLink runat="server" ID="hyphidden" Visible="false" >
   <asp:ModalPopupExtender runat="server" ID="ModalPopupExtenderQ" PopupControlID="EditPanel" TargetControlID="hyphidden" CancelControlID="lnkCancel" >
   
   
   

   <asp:Panel runat="server" ID="EditPanel"  >
<asp:TextBox runat="server" ID="InstituteID" Text="institute Name" Visible="false" >
<asp:TextBox runat="server" ID="YearStart" Text="Year Started">
<asp:TextBox runat="server" ID="YearEnd" Text="Year Ended">
<asp:LinkButton ID="lnkUpdate" runat="server" CommandName="Update" CssClass="btn" Text="Update" >
<asp:LinkButton ID="lnkCancel" runat="server"  CssClass="btn" Text="Cancel">

  
 
</itemtemplate>
    


<edititemtemplate>
 
</edititemtemplate>

<insertitemtemplate>
<asp:Panel ID="PanelInset" runat="server">
<asp:TextBox runat="server" ID="InstituteID" Text="institute Name" >
<asp:TextBox runat="server" ID="YearStart" Text="Year Started">
<asp:TextBox runat="server" ID="YearEnd" Text="Year Ended">
<asp:Button ID="InsertButton" runat="server" 

		CommandName="Insert" Text="Insert" />

</insertitemtemplate>



CS代码:-



CS Code:-

protected void ListView1_ItemCommand(object sender, ListViewCommandEventArgs e)
            {
                if (e.CommandName == "Insert")
                {
                    TextBox InstituteID = (TextBox)e.Item.FindControl("txtFname");
                    TextBox YearStart = (TextBox)e.Item.FindControl("txtLname");
                    TextBox YearEnd = (TextBox)e.Item.FindControl("txtCtype");
                   
                }
                else if (e.CommandName == "Update")
                {
                    TextBox txtId = (TextBox)e.Item.FindControl("txtUpId");
                    TextBox txtFname = (TextBox)e.Item.FindControl("txtUpFname");
                    TextBox txtLname = (TextBox)e.Item.FindControl("txtUpLname");
                    TextBox txtCtype = (TextBox)e.Item.FindControl("txtUpCtype");
                    
                }
                else if (e.CommandName == "Delete")
                {
                    TextBox txtId = (TextBox)e.Item.FindControl("txtUpId");
                    
                }
                else if (e.CommandName == "Edit")
                {
                    Label lblInstituteId = (Label)e.Item.FindControl("lblId");
                    Label lblYearStart = (Label)e.Item.FindControl("lblStartYr");
                    Label lblYearEnd = (Label)e.Item.FindControl("lblEndYr");

                    TextBox tbxInstituteID = (TextBox)e.Item.FindControl("txtFname");
                    TextBox tbxtbxYearStart = (TextBox)e.Item.FindControl("txtLname");
                    TextBox tbxYearEnd = (TextBox)e.Item.FindControl("txtCtype");

                    tbxInstituteID.Text = lblInstituteId.Text;
                    tbxtbxYearStart.Text = lblYearStart.Text;
                    tbxYearEnd.Text = lblYearEnd.Text;
                    this.ModalPopupExtenderQ.show();


                }
            }

推荐答案

无论如何都不要与ModalPopupExtender一起使用.
Don''t go with ModalPopupExtender anyway it is not going to work with IE.


这篇关于列表视图中的Modalpopup Extender不包含值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆