Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
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.NET
<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 Code:-

C#
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();


                }
            }
Posted
Updated 17-Sep-11 19:32pm
v2

1 solution

Don't go with ModalPopupExtender anyway it is not going to work with IE.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900