I am using listview. In listview, i have button for Update and delete. If you click on Update button then at that time one panel is opened with its respective text values. In the Panel i have four text box and two button for Update and cancel. To populate
the Panel i am using the ModelPopupExtender. So in Panel Button events are not firing. Within panel i am using the UpdatePanel. So what i have to do. Please give me suggestion. Now here is my code:
Galvin
Member
78 Points
100 Posts
Ajax modelpopextender control
Mar 31, 2012 08:32 AM|LINK
Hi,
I am using listview. In listview, i have button for Update and delete. If you click on Update button then at that time one panel is opened with its respective text values. In the Panel i have four text box and two button for Update and cancel. To populate the Panel i am using the ModelPopupExtender. So in Panel Button events are not firing. Within panel i am using the UpdatePanel. So what i have to do. Please give me suggestion. Now here is my code:
<asp:ListView ID="lvProfile" runat="server" OnItemDeleting="LvProfileItemDeleting"
OnItemEditing="LvProfileItemEditing" OnDataBound="lvProfile_DataBound" OnPreRender="lvProfile_PreRender"
OnItemDataBound="lvProfile_ItemDataBound">
<LayoutTemplate>
<table class="table font no-bottom-margin" width="100%">
<thead>
<tr>
<th class="sorting_disabled" style="width: 4%;">
<span>
<img src="../Images/icons/fugue/company_profile.png" /></span>
</th>
<th>
Company Name
</th>
<th>
Phone
</th>
<th>
Email
</th>
<th>
Website
</th>
<th>
Action
</th>
</tr>
</thead>
<tbody>
<asp:PlaceHolder runat="server" ID="itemPlaceholder" />
</tbody>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr>
<td class="th table-check-cell">
<asp:Label ID="ID" runat="server" Text='<%# Eval("Id") %>' Visible="false" /><%#Container.DataItemIndex+1 %>
</td>
<td>
<asp:Label ID="Profile_NAME" runat="server" Text='<%# Eval("Name") %>' />
</td>
<td>
<asp:Label ID="Phone" runat="server" Text='<%# Eval("Phone") %>' />
</td>
<td>
<asp:Label ID="Email" runat="server" Text='<%# Eval("Email") %>' />
</td>
<td>
<asp:Label ID="Website" runat="server" Text='<%# Eval("WebSite") %>' />
</td>
<td>
<asp:ImageButton ID="ImgEdit" runat="server" CommandName="Edit" AlternateText="Edit"
ToolTip="Edit" ImageUrl="../Images/icons/fugue/pencil.png" CausesValidation="False" />
<asp:ImageButton ID="ImgDelete" runat="server" CommandName="Delete" AlternateText="Delete"
ToolTip="Delete" ImageUrl="../Images/icons/fugue/cross-circle.png" />
</td>
<TK1:ConfirmButtonExtender ID="ConfirmDelete" runat="server" TargetControlID="ImgDelete"
ConfirmText='<%# "Are you sure want to delete " + Eval("Name") + " ? " %>' OnClientCancel="CancelClick">
</TK1:ConfirmButtonExtender>
</tr>
<TK1:ModalPopupExtender ID="modelpopup" runat="server" TargetControlID="ImgEdit"
RepositionMode="RepositionOnWindowResizeAndScroll" PopupControlID="panelEdit"
PopupDragHandleControlID="panelEdit" Drag="true" BackgroundCssClass="modal" CancelControlID="LinkButton2" >
</TK1:ModalPopupExtender>
<asp:Panel ID="panelEdit" runat="server" Style="display: none" Width="600px">
<asp:UpdatePanel ID="UpdatepanelAdd1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="modal">
<div class="modal-window " style="top: 59px; width: 600px; margin-left: 30%">
<ul class="action-tabs">
<li>
<asp:LinkButton ID="LinkButton2" runat="server" OnClick="Close_Click" ToolTip="Close window"
CausesValidation="False"><img width="32px" height="32px" src="../images/icons/fugue/btn_close.png"></asp:LinkButton>
</li>
</ul>
<div class="block-content margin-right margin-top1em">
<div class="block-controls">
<h1>
<asp:Label ID="lblCreate1" runat="server" Text="Update Profile"></asp:Label>
</h1>
</div>
<div class="float-left side1">
<label for="complex-en-style">
Company Name
</label>
</div>
<div>
<asp:TextBox ID="edittxtName" runat="server" TabIndex="1" Width="145px" AutoPostBack="True"
Text='<%# Eval("Name") %>'>
</asp:TextBox>
<hr />
<div class="float-left side1">
<label for="complex-en-style">
Address</label></div>
<div>
<asp:TextBox ID="edittxtAddress" runat="server" TextMode="MultiLine" TabIndex="2"
Width="145px" Text='<%# Eval("Address") %>'></asp:TextBox>
</div>
<hr />
<div class="float-left side1">
<label for="complex-en-style">
Phone</label></div>
<div>
<asp:TextBox ID="edittxtCountryCode" runat="server" MaxLength="3" ReadOnly="true"
Width="24px" Text="+91"></asp:TextBox>
<asp:TextBox ID="edittxtStateCode" AutoCompleteType="Disabled" runat="server" Width="30px"
MaxLength="4" TabIndex="3" Text='<%# StateCode(Eval("Phone")) %>'></asp:TextBox>
<asp:TextBox ID="edittxtPhone" runat="server" MaxLength="8" AutoCompleteType="Disabled"
Width="60px" TabIndex="4" Text='<%# PhoneNumber(Eval("Phone")) %>'></asp:TextBox>
</div>
<hr />
<div class="float-left side1">
<label for="complex-en-style">
Fax</label></div>
<div>
<asp:TextBox ID="edittxtCountryCode2" runat="server" MaxLength="3" ReadOnly="true"
Text="+91" Width="24px"></asp:TextBox>
<asp:TextBox ID="edittxtStateCode2" runat="server" Width="30px" MaxLength="4" TabIndex="5"
Text='<%# StateFaxCode(Eval("Fax")) %>'></asp:TextBox>
<asp:TextBox ID="edittxtFax" runat="server" TabIndex="6" Width="60px" MaxLength="8"
Text='<%# FaxNumber(Eval("Fax")) %>'></asp:TextBox>
</div>
<hr />
<div class="float-left side1">
<label for="complex-en-style">
Email
</label>
</div>
<div>
<asp:TextBox ID="edittxtEmail" runat="server" TabIndex="7" Width="145px" Text='<%# Eval("Email") %>'></asp:TextBox>
</div>
<hr />
<div class="float-left side1">
<label for="complex-en-style">
Website</label></div>
<div>
<asp:TextBox ID="edittxtWebsite" runat="server" TabIndex="8" Width="145px" Text='<%# Eval("WebSite") %>'></asp:TextBox>
</div>
<hr />
<div class="message no-bottom-margin no-margin">
<asp:Label ID="lblProfileResult" runat="server" Text=""></asp:Label></div>
<div class="block-footer">
<div class="float-right margin-right">
<asp:Button ID="btnUpdateProfile" CssClass="buttonblue" runat="server" Text="Edit"
TabIndex="9" OnClick="btnUpdateProfile_Click" />
<asp:Button ID="btnUpdateCancel" CssClass="buttonblue" runat="server" Text="Cancel"
TabIndex="10" OnClick="btnUpdateCancel_Click" />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</div>
</div>
</div>
<div class="modal-resize-tl">
</div>
<div class="modal-resize-t">
</div>
<div class="modal-resize-tr">
</div>
<div class="modal-resize-r">
</div>
<div class="modal-resize-br">
</div>
<div class="modal-resize-b">
</div>
<div class="modal-resize-bl">
</div>
<div class="modal-resize-l">
</div>
</div>
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
</ItemTemplate>
</asp:ListView>
amit.jain
Star
11225 Points
1815 Posts
Re: Ajax modelpopextender control
Mar 31, 2012 09:32 AM|LINK
refer http://csharpdotnetfreak.blogspot.com/2011/04/ajax-modalpopextender-gridview-master.html
amiT jaiN
ASP.NET C# VB Articles And Code Examples
Galvin
Member
78 Points
100 Posts
Re: Ajax modelpopextender control
Apr 02, 2012 06:13 AM|LINK
No. It is not helpful for me. But anyway example is too much good.
umamahesh202...
Member
164 Points
74 Posts
Re: Ajax modelpopextender control
Apr 02, 2012 06:38 AM|LINK
I think this link will help you
http://www.codeproject.com/Articles/34996/ASP-NET-AJAX-Control-Toolkit-ModalPopupExtender-Co
http://www.dotnetcurry.com/ShowArticle.aspx?ID=285
http://deepumi.wordpress.com/2010/03/20/asp-net-3-5-ajax-modal-popup-extender-with-user-control-event-bubbling/
chikkanti
Member
270 Points
80 Posts
Re: Ajax modelpopextender control
Apr 02, 2012 02:22 PM|LINK
refer the following link for gridview edit update dlete using modal popup extender
http://chikkanti.wordpress.com/2011/11/17/305/