Nested ajax UpdatePanels wont clear texbox content after postback? - asp.net

I have a two UpdatePanels one UpdatePanel contains the Grid and the other contains data entry. When a user click on a ImageButton within the GridView it will then show to ModalPopupExtender and display the second UpdatePanel. When the user enters the data into the fields under the second UpdatePanel and if they Click the Button Report or Button Cancel I am Forcing the postback on both buttons. The problem is if the user goes back in and click on the different row on the page the data under the UpdatePanel2 is not Cleared all data remains from the first row clicked... I have tried UpdatePanel1.Update(), UpdatePanel2.Update() full page PostBack nothing works. The only thing that works is if I do Response.Redirect back to itself. But I am trying to avoid doing that and also trying to avoid clearing fields back to nothing with the .cs code. Wondering if there is a way to postback and clear all the fields under the UpdatePanel2. Thanks for your help in advance.
<asp:UpdatePanel ID="upGrid" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div>
<span id="lblTab" runat="server" style=" font-weight:bold; font-size:larger">All Published Reports</span>
<br />
<asp:GridView
ID="gvReports"
runat="server"
CssClass="gridview"
RowStyle-CssClass="gridview_itm"
AlternatingRowStyle-CssClass="gridview_aitm"
HeaderStyle-CssClass="gridview_hdr"
PagerStyle-CssClass="gridview_pgr"
AutoGenerateColumns="False"
Width="100%" onrowcommand="gvReports_RowCommand">
<Columns>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:LinkButton ID="btnReport" runat="server" CommandName="Report" CommandArgument='<%#Eval("n_ReportFileName")%>' Text='<%#Eval("n_Name")%>' CausesValidation="false"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<%#Eval("n_Description")%>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="Button1" PopupControlID="ReportParameterPanel" BackgroundCssClass="modalBackground" DropShadow="True">
</asp:ModalPopupExtender>
<asp:Button ID="Button1" runat="server" Text="Button" style="visibility:hidden"/>
<asp:Panel ID="ReportParameterPanel" runat="server" Height="375px"
Width="700px" BackColor="#f4de90"
HorizontalAlign="Center" BorderColor="#666666" BorderStyle="Outset"
BorderWidth="5px">
<table style="height: 50px; width: 685px; text-align: left">
<span id="lblReportName" runat="server" style="font-weight:bold; font-size:larger"></span>
<tr>
<td align="left" style="padding-left: 5px; width: 335px;" valign="top">
<span id="StarDateStar" runat="server" style="color: Red">*Optional </span><span id="lblStartDate" runat="server">Start Date: </span>
<asp:TextBox ID="tbStartDate" runat="server"></asp:TextBox>
<asp:ImageButton ID="imgCalendar" runat="server" ImageUrl="~/App_Themes/Sugar2006/images/Calendar_scheduleHS.png" ImageAlign="Middle" />
<asp:CalendarExtender ID="ceStartDate" runat="server" TargetControlID ="tbStartDate" PopupButtonID="imgCalendar" />
<asp:MaskedEditExtender ID="mexStartDate" runat="server"
TargetControlID="tbStartDate"
Mask="99/99/9999"
MaskType="Date"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError" />
<br />
<asp:MaskedEditValidator ID="mevStartDate" runat="server"
ControlToValidate="tbStartDate"
ControlExtender="mexStartDate"
Display="Dynamic"
InvalidValueMessage="This date is invalid!" Font-Bold="True"
ForeColor="#D50000" ValidationGroup="vgMyGroup" />
</td>
<td align="left" style="padding-right: 5px; padding-bottom: 5px; width: 350px;" valign="top">
<span id="EndDateStar" runat="server" style="color: Red">*Optional </span><span id="lblEndDate" runat="server">End Date: </span>
<asp:TextBox ID="tbEndDate" runat="server"></asp:TextBox>
<asp:ImageButton ID="imgCalendar2" runat="server" ImageUrl="~/App_Themes/Sugar2006/images/Calendar_scheduleHS.png" ImageAlign="Middle" />
<asp:CalendarExtender ID="ceEndDate" runat="server" TargetControlID ="tbEndDate" PopupButtonID="imgCalendar2" />
<asp:MaskedEditExtender ID="mexEndDate" runat="server"
TargetControlID="tbEndDate"
Mask="99/99/9999"
MaskType="Date"
MessageValidatorTip="true"
OnFocusCssClass="MaskedEditFocus"
OnInvalidCssClass="MaskedEditError" />
<br />
<asp:MaskedEditValidator ID="mevEndDate" runat="server"
ControlToValidate="tbEndDate"
ControlExtender="mexEndDate"
Display="Dynamic"
InvalidValueMessage="This date is invalid!" Font-Bold="True"
ForeColor="#D50000"
ValidationGroup="vgMyGroup" />
</td>
</tr>
</table>
<table style="height: 25px; width: 685px; text-align: left">
<tr>
<td align="left" style="padding-left: 5px; width: 335px;" valign="top">
<span id="lblOperator" runat="server">Operator:</span>
<asp:DropDownList ID="Parameters" runat="server" style="margin-left: 73px">
<asp:ListItem Selected="True"><</asp:ListItem>
<asp:ListItem>></asp:ListItem>
<asp:ListItem>=</asp:ListItem>
<asp:ListItem>Completed</asp:ListItem>
<asp:ListItem>Not Completed</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
<asp:RadioButtonList ID="GroupingList" runat="server" Height="25px"
RepeatDirection="Horizontal"
AutoPostBack="true" onselectedindexchanged="GroupingList_SelectedIndexChanged"
CausesValidation="true" ValidationGroup="vgMyGroup" />
<table style="height: 25px; width: 685px; text-align: left">
<tr id="rowEntitySelectionLabels" runat="server">
<td style="padding-left: 3px; height: 16px; width: 300px;">
<asp:Label ID="GroupItemInputLabel" runat="server" />
</td>
<td style="height: 16px; width: 48px;">
</td>
<td style="height: 16px; width: 300px;">
<asp:Label ID="GroupItemsListInputLabel" runat="server" />
</td>
</tr>
<tr id="rowEntitySelections" runat="server">
<td valign="top" style="padding-left: 3px; height: 100px; width: 300px;">
<asp:ListBox ID="GroupItemInput" runat="server" Width="300px" Height="150px"
SelectionMode="multiple" BackColor="White" ForeColor="Black" />
</td>
<td align="center" valign="top" style="height: 100px; width: 50px;">
<br />
<asp:ImageButton ID="btnAddItem"
ImageUrl="~/App_Themes/Sugar2006/images/Actions-arrow-right-icon.png" runat="server"
OnClick="btnAddItem_Click" Height="18px" Width="25px"
ToolTip="Adds the Selected <Item>." CausesValidation="true" ValidationGroup="vgMyGroup" /><br />
<asp:ImageButton ID="btnAddAllItems"
ImageUrl="~/App_Themes/Sugar2006/images/Actions-arrow-right-double-icon.png" runat="server"
OnClick="btnAddAllItems_Click" Height="18px" Width="25px"
ToolTip="Adds all of the <Items>." CausesValidation="true" ValidationGroup="vgMyGroup" /><br />
<br /><br />
<asp:ImageButton ID="btnRemoveItem"
ImageUrl="~/App_Themes/Sugar2006/images/Actions-arrow-left-icon.png" runat="server"
OnClick="btnRemoveItem_Click" Height="18px" Width="25px"
ToolTip="Removes the Selected <Item>." CausesValidation="true" ValidationGroup="vgMyGroup" /><br />
<asp:ImageButton ID="btnRemoveAllItems"
ImageUrl="~/App_Themes/Sugar2006/images/Actions-arrow-left-double-icon.png" runat="server"
OnClick="btnRemoveAllItems_Click" Height="18px" Width="25px"
ToolTip="Removes all of the <Items>." CausesValidation="true" ValidationGroup="vgMyGroup" />
</td>
<td valign="top" style="height: 100px; width: 300px;" id="TD1">
<asp:ListBox ID="GroupItemsList" runat="server" Width="300px" Height="150px"
SelectionMode="multiple" BackColor="White" ForeColor="Black" />
</td>
</tr>
</table>
<asp:Button ID="btnClose" runat="server" Text="Close" CssClass="btn" onclick="btnClose_Click" CausesValidation="false" />
<asp:Button ID="btnSend" runat="server" Text="Report" CssClass="btn" OnClick="btnSend_Click" Enabled="false" CausesValidation="true" ValidationGroup="vgMyGroup" />
</asp:Panel>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="btnSend" />
<asp:PostBackTrigger ControlID="btnClose" />
</Triggers>
</asp:UpdatePanel>
</div>
</ContentTemplate>
</asp:UpdatePanel>

Try setting the UpdatePanel.UpdateMode Property to Conditional
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
<!-- other stuff -->
</asp:UpdatePanel>
The child update panel will only refresh its children, not its parent, if the update mode is not set to conditional.
And here are a few more ways of updating update panels:
http://lisazhou.wordpress.com/2008/01/07/update-panel-different-ways-of-triggering-udates/

Related

Update Panel, Update Progress and DropDown List

<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
<Services>
<asp:ServiceReference Path="Machine.asmx" />
</asp:ScriptManager>
<div align="center" style="width:auto" >
<asp:UpdatePanel ID="up1" runat="server" Visible="true" UpdateMode="Conditional">
<ContentTemplate>
<table class="nav-justified" border="1" id="table1">
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text="Select Search Criteria"></asp:Label>
</td>
<td>
<asp:DropDownList ID="ddlSearchCriteria" runat="server" AutoPostBack="true" EnableViewState="true" OnSelectedIndexChanged="ddlSearchCriteria_SelectedIndexChanged" Height="30px" Width="200px">
<asp:ListItem Value="0">Select</asp:ListItem>
<asp:ListItem Value="1">All</asp:ListItem>
<asp:ListItem Value="2">Data Center</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr id="trDC" runat="server" visible="false"> <td>
<asp:Label ID="lblRegion" runat="server" Text="Select DataCenter"></asp:Label>
</td>
<td>
<asp:DropDownList ID="ddlDC" runat="server" AutoPostBack="false" EnableViewState="true" OnSelectedIndexChanged="ddlDC_SelectedIndexChanged" Height="30px" Width="200px">
<asp:ListItem Value="0">Select</asp:ListItem>
<asp:ListItem Value="1">a </asp:ListItem>
</asp:DropDownList></td>
</tr>
<tr id="tr1" runat="server" visible="false" >
<td>
<asp:Label ID="lblOrder" runat="server" Text="Order For SOEID"></asp:Label>
</td>
<td >
<asp:TextBox ID="txtOrderFor" runat="server" Height="20px" Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click" />
</td>
</tr>
</table>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="up1" DisplayAfter="0" DynamicLayout="false">
<ProgressTemplate>
<div style="position:absolute; left:45%;">
<div style="position:relative; left:45%;">
<table border="0" align="center">
<tr>
<td>
<img alt=""src="img/loading.gif" height="50px" width="50px" />
</td>
</tr>
</table>
<center>
Please wait...
</center>
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</div>
<asp:UpdatePanel ID="up2" runat="server">
<ContentTemplate>
<asp:Label ID="lblRows" runat="server" Font-Size="Large" Visible="false" ></asp:Label>
<asp:GridView ID="gvDetails" runat="server" AllowPaging="True" AutoGenerateColumns="False" CellPadding="3" CssClass="bootstrap dataTables_wrapper" DataKeyNames="Order_Item_Id” EnableViewState="false" HeaderStyle-HorizontalAlign="Left" OnPageIndexChanging="gvDetails_PageIndexChanging" OnRowCommand="gvDetails_RowCommand" OnRowDataBound="gvDetails_RowDataBound" PageSize="15" ShowHeaderWhenEmpty="true" Visible="true" Width="100%">
<Columns>
<asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Select">
<ItemTemplate>
<asp:CheckBox ID="chkBox1" runat="server" AutoPostBack="true" OnCheckedChanged="Check_Clicked"/>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="Order_Item_Id" HeaderStyle-HorizontalAlign="Left" HeaderText="Order Id" />
</Columns>
</asp:GridView>
</div>
<asp:Button ID="Button4" runat="server" Font-Bold="True" Font-Size="XX-Large" OnClick="Button4_Click" Text="Export To Excel" visible="false" />
<asp:Button ID="Button3" runat="server" Font-Bold="True" Font-Size="XX-Large" OnClick="Button3_Click" Text="Submit" Visible="false" />
<asp:Button ID="Button1" runat="server" Font-Bold="True" Font-Size="XX-Large" OnClick="Button1_Click" Text="Cancel" Visible="false" />
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="Button4" />
<asp:PostBackTrigger ControlID="Button3" />
<asp:PostBackTrigger ControlID="Button1" />
</Triggers>
</asp:UpdatePanel>
I have two update panel and 1 update progress on my aspx page. My first update panel contains two dropdown, on change of first dropdown, second populates and also there is a submit button in the update panel.
When I use selectedindexchange of dropdown, Autopostback occurs, update progress works but I don't want it to work on that event. It should work only on the submit click.
Second update panel contains the data to be shown on click of submit button.
Also,My update progress is not in any of the update panel, it is in a div between both the update panel.

Dropdown List issue in ASP Panel control

I am using asp Panel control in which I have a dropdown list for different Timezones to select.
However, When I select any timezone It disappears when I open the pop up next time.
Can you please suggest or provide some pointers ?
<asp:PlaceHolder ID="DisplayMode" runat="server">
<div id="ListBranch" style="text-align: left">
<asp:Button ID="AddBranch" runat="server" Text="Add Branch" OnClick="AddBranch_Click" />
<act:ModalPopupExtender ID="ModalPopupExtenderBranch" runat="server" TargetControlID="AddBranch" PopupControlID="pnlAddBranch"
CancelControlID="btnCancel" BackgroundCssClass="modalBackground">
</act:ModalPopupExtender>
<act:ToolkitScriptManager ID="smBranch" runat="server">
</act:ToolkitScriptManager>
<div>
<br />
<asp:GridView runat="server" ID="gvBranchList" DataKeyNames="BranchID" AutoGenerateColumns="false" Font-Size="Small">
<RowStyle BackColor="#EFF3FB" />
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#336699" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="Branch Name" HeaderText="Branch Name" />
<asp:BoundField DataField="Timezone" HeaderText="Timezone" />
<asp:TemplateField HeaderText="Edit">
<ItemTemplate>
<asp:Button ID="Edit" runat="server" Text="Edit" OnClick="Edit_Click" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<br />
<asp:Label ID="lblresult" runat="server" />
<asp:Button ID="btnShowPopup" runat="server" Style="display: none" />
<asp:Button ID="UpdateBranch" CommandName="Update" runat="server" Text="Ok" OnClick="Ok_Click" Style="display: none" />
<asp:Panel ID="pnlAddBranch" runat="server" BackColor="White" Height="80%" Width="100%" Font-Size="Small" Style="top: 40px !important;">
<table style="border: solid 2px #336699; width: 100%; height: 100%; font-size: small;" cellpadding="0" cellspacing="0">
<tr style="background-color: #336699">
<td colspan="2" style="height: 5%; color: White; font-weight: bold; font-size: larger" align="center">Branch Details</td>
</tr>
<tr>
<td align="left">Branch Name: </td>
<td>
<asp:TextBox ID="BranchName" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td align="left">Timezone: </td>
<td>
<asp:DropDownList ID="ddlTimezones" AutoPostBack="false" OnSelectedIndexChanged="ddlTimezones_SelectedIndexChanged" runat="server" />
</td>
</tr>
<tr>
<td align="left">Assigned Holidays: </td>
<td>
<asp:CheckBoxList ID="chkAssignedHolidays" runat="server" RepeatColumns="3" Font-Size="Small" />
</td>
</tr>
<tr>
<td></td>
<td>
<asp:Button ID="Ok" CommandName="Add" runat="server" Text="Ok" OnClick="Ok_Click" />
<asp:Button ID="Cancel" Commandname="Cancel" runat="server" Text="Cancel" OnClick="Cancel_Click" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:Label ID="lblBranchID" runat="server" Style="display: none"></asp:Label>
</td>
</tr>
</table>
</asp:Panel>
</div>
</div>
</asp:PlaceHolder>

Asp .net Show modal popup on click event linkbutton which is on Modal popup

I shown Modal popup (Modal2) on this Modal popup I have grid contain link button.
on click event of link button i have to show another modal popup having grid.
My First Modal popup Showing
<asp:Button ID="btnScholershipApp" runat="server" Text="Button" SkinID="SelectButton" />
<Ajax:ModalPopupExtender ID="Modal2" runat="server" PopupControlID="table2" CancelControlID="img1"
TargetControlID="btnScholershipApp" OnCancelScript="javascript:__doPostBack('clearfields2')">
</Ajax:ModalPopupExtender>
First Modal popup
<table id="table2" runat="server" border="0" cellpadding="0" cellspacing="0" height="100%"
style="border-collapse: collapse; height: auto; margin: 0px; padding: 0px; display: none;"
width="1000" class="popupheading">
<tr>
<td>
<div style="width: 1000px; height: auto;">
<div style="width: 1000px; height: 40px; background-image: url('../../../PopU/top.png');
background-repeat: no-repeat;">
<img id="img1" runat="server" height="40" src="~/Images/close1.png" style="float: right;"
width="40" />
</div>
<div style="width: 980px; height: auto; min-height: 100px; background-image: url('../../../PopU/center_bg.png');
background-repeat: repeat-y; padding: 0 10px 0 10px;">
<asp:Panel ID="modal_panel2" runat="server" Height="550" Width="980">
<table cellpadding="7px" cellspacing="7px" width="100%">
<tr>
<td>
<fieldset>
<legend class="legend">Search </legend>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<asp:Label ID="Label5" runat="server" Text="Student Name"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtSAStudentName" runat="server"></asp:TextBox>
</td>
<td>
<asp:Label ID="Label6" runat="server" Text="Student ID"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtSAStudentID" runat="server"></asp:TextBox>
</td>
<td>
<asp:Label ID="Label4" runat="server" Text="Scholership Name"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtSAScholershipName" runat="server"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label7" runat="server" Text="University PRN"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtSAScholershipPRN" runat="server"></asp:TextBox>
</td>
<td>
<asp:Label ID="Label12" runat="server" Text="Date Of Birth"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtSADateOfBirth" runat="server"></asp:TextBox>
<ajaxtoolkit:CalendarExtender ID="CalendarExtender1" runat="server" Enabled="True"
TargetControlID="txtSADateOfBirth">
</ajaxtoolkit:CalendarExtender>
</td>
</tr>
</table>
</fieldset>
</td>
</tr>
</table>
<table width="100%">
<tr style="background-color: #F6F0DB;">
<td align="center" colspan="4">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:HiddenField ID="hfScholershipName" runat="server" />
<asp:HiddenField ID="hfScholershipPRN" runat="server" />
<asp:HiddenField ID="hfScholershipApplicationID" runat="server" />
<asp:HiddenField ID="hfScholershipDocumentID" runat="server" />
<asp:GridView ID="grdScholershipApp" runat="server" AutoGenerateColumns="false" AllowPaging="True"
OnPageIndexChanging="grdScholershipApp_PageIndexChanging" PageSize="10" Width="970px">
<Columns>
<asp:BoundField DataField="StudentId" HeaderText="Student ID" />
<asp:BoundField DataField="FullName" HeaderText="Student Name">
<ItemStyle HorizontalAlign="Center" Width="250" />
</asp:BoundField>
<asp:BoundField DataField="ScholershipPRN" HeaderText="University PRN" />
<asp:BoundField DataField="DateOfBirth" HeaderText="Date of birth" />
<asp:BoundField DataField="ScholershipName" HeaderText="Scholership Name" />
<asp:TemplateField HeaderText="Options">
<ItemTemplate>
<asp:UpdatePanel ID="pnlup2" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="btnEditStudentApplication" />
</Triggers>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnStudentDocumentIDShow" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:ImageButton ID="btnEditStudentApplication" runat="server" CommandArgument='<%#Eval("PanomtechServiceID")+";"+Eval("StudentID")+";"+Eval("ScholershipPRN")+";"+Eval("ScholershipName")%>'
SkinID="Select" OnClick="btnEditStudentApplication_Click" />
<%--<asp:Panel ID="Panel12" runat="server" >
<asp:UpdatePanel ID="UpdatePanel4" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="hfbtnStudentDocumentIDShow" runat="server" Style="display: none;" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="hfbtnStudentDocumentIDShow" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
</asp:Panel>--%>
<asp:LinkButton ID="btnStudentDocumentIDShow" runat="server" Text="Documents" CommandArgument='<%#Eval("PanomtechServiceID")+";"+Eval("StudentID")+";"+Eval("StudentDocumentID")%>'
OkControlID="hfbtnStudentDocumentIDShow" />
<%-- OnClick="hfbtnStudentDocumentIDShow_Click" --%>
<%--<Ajax:ModalPopupExtender ID="modal4" runat="server" PopupControlID="table4" CancelControlID="img3"
TargetControlID="btnStudentDocumentIDShow" OnCancelScript="javascript:__doPostBack('clearfields4')">
</Ajax:ModalPopupExtender>--%>
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<EmptyDataTemplate>
no data.......
</EmptyDataTemplate>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</asp:Panel>
</div>
<div style="width: 1000px; height: 40px; background-image: url('../../../PopU/bottom.png');
background-repeat: no-repeat;">
</div>
</div>
</td>
</tr>
</table>
<Ajax:AnimationExtender ID="AnimationExtender2" runat="server" TargetControlID="btnScholershipApp">
<Animations>
<OnClick>
<Parallel AnimationTarget="table2"
Duration=".9" Fps="50">
<FadeIn Duration=".9"/>
</Parallel>
</OnClick>
</Animations>
</Ajax:AnimationExtender>
LinkButton Event
protected void hfbtnStudentDocumentIDShow_Click(object sender, EventArgs e)
{
modal4.Show();
}
Second Modal popup
<table id="table4" runat="server" border="0" cellpadding="0" cellspacing="0" height="100%"
style="border-collapse: collapse; height: auto; margin: 0px; padding: 0px;" width="1000"
class="popupheading">
<tr>
<td>
<div style="width: 1000px; height: auto;">
<div style="width: 1000px; height: 40px; background-image: url('../../../PopU/top.png');
background-repeat: no-repeat;">
<img id="img4" runat="server" height="40" src="~/Images/close1.png" style="float: right;"
width="40" />
</div>
<div style="width: 980px; height: auto; min-height: 100px; background-image: url('../../../PopU/center_bg.png');
background-repeat: repeat-y; padding: 0 10px 0 10px;">
<asp:Panel ID="modal_panel4" runat="server" Height="550" Width="980">
<table width="100%">
<tr style="background-color: #F6F0DB;">
<td align="center" colspan="4">
<asp:UpdatePanel ID="uppanel" runat="server">
<ContentTemplate>
<asp:GridView ID="grdStudentDocuments" runat="server" AutoGenerateColumns="false"
AllowPaging="True" OnPageIndexChanging="grdStudentDocuments_PageIndexChanging"
PageSize="10" Width="970px">
<Columns>
<asp:BoundField DataField="StudentId" HeaderText="Student ID" />
<asp:BoundField DataField="FullName" HeaderText="Student Name">
<ItemStyle HorizontalAlign="Center" Width="250" />
</asp:BoundField>
<asp:BoundField DataField="DocumentName" HeaderText="Document Name" />
<asp:BoundField DataField="ScholershipPRN" HeaderText="University PRN" />
<asp:BoundField DataField="ScholershipName" HeaderText="Scholership Name" />
<asp:TemplateField HeaderText="Select">
<ItemTemplate>
<asp:UpdatePanel ID="pnlup3" runat="server">
<Triggers>
<asp:PostBackTrigger ControlID="btnEditSStudentDocuments" />
</Triggers>
<ContentTemplate>
<asp:ImageButton ID="btnEditSStudentDocuments" runat="server" CommandArgument='<%#Eval("StudentDocumentID")%>'
SkinID="Select" OnClick="btnEditSStudentDocuments_Click" />
</ContentTemplate>
</asp:UpdatePanel>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<EmptyDataTemplate>
no data.......
</EmptyDataTemplate>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</asp:Panel>
</div>
<div style="width: 1000px; height: 40px; background-image: url('../../../PopU/bottom.png');
background-repeat: no-repeat;">
</div>
</div>
</td>
</tr>
</table>
<asp:Button ID="hfbtnStudentDocumentIDShow" runat="server" OnClick="hfbtnStudentDocumentIDShow_Click"
Style="display: none;" />
<Ajax:ModalPopupExtender ID="modal4" runat="server" PopupControlID="table4" CancelControlID="img3"
TargetControlID="hfbtnStudentDocumentIDShow" OnCancelScript="javascript:__doPostBack('clearfields4')">
</Ajax:ModalPopupExtender>
<Ajax:AnimationExtender ID="AnimationExtender4" runat="server" TargetControlID="hfbtnStudentDocumentIDShow">
<Animations>
<OnClick>
<Parallel AnimationTarget="table4"
Duration=".9" Fps="50">
<FadeIn Duration=".9"/>
</Parallel>
</OnClick>
</Animations>
</Ajax:AnimationExtender>
Problem
When I click on link button it does not display any thing Please help me
Try this, i read somewhere on a blog that when i was stuck in this issue that using ModaloPopup Extender in Update Panel causes issue if we do not use them in the right order, the code i am posting works fine for me, in my case also i am using ModalPopupExtender within update panel try this order of ModalPopupExtender with Update Panel, it will surely work:
<div class="popup">
<asp:Button ID="Button7" runat="server" Text="Button" Style="display: none;" />
<asp:Button ID="Button8" runat="server" Style="display: none;" />
<asp:ModalPopupExtender ID="ModalPopupUploadFiles" BehaviorID="ModalPopupUploadFiles" runat="server" CancelControlID="ImageButton1"
TargetControlID="Button7" PopupControlID="PanelUploadFiles" PopupDragHandleControlID="PopupHeader"
Drag="true" BackgroundCssClass="Overlay">
<Animations>
<OnShown>
<FadeIn Duration=".50" Fps="10" />
</OnShown>
</Animations>
</asp:ModalPopupExtender>
<!--unique css-->
<asp:Panel ID="PanelUploadFiles" runat="server" Style="display: none; overflow:scroll; width:750px; height:400px;" class="PopUpPanel">
<asp:Panel ID="panel1" runat="server" class="closeButton">
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/cross.png"/>
</asp:Panel>
<asp:UpdatePanel ID="updtPanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="True">
<ContentTemplate>
<br />
<br />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
<tr>
<td align="left" valign="top">
<table id="delgateContainer" width="90" border="0" align="left" cellpadding="0" cellspacing="3">
<tr align="center" valign="middle">
<td><asp:ImageButton ID="btnAddFiles" ClientIDMode="Static" ImageUrl="~/images/add.gif" runat="server"/></td>
<td><asp:ImageButton ID="btnStartUpload" ClientIDMode="Static" ImageUrl="~/images/start.gif" runat="server" OnClick="btnStartUpload_Click" /></td>
<td><asp:ImageButton ID="btnCancelUpload" ImageUrl="~/images/cancel.gif" runat="server" OnClick="btnCancelUpload_Click" /></td>
<td><asp:ImageButton ID="btnDeleteAllUploads" ClientIDMode="Static" ImageUrl="~/images/delete2.gif" runat="server" OnClick="btnDeleteAllUploads_Click" /></td>
<td align="left"><asp:CheckBox ID="chckBoxDeleteAll" ClientIDMode="Static" runat="server" /></td>
<td> </td>
</tr>
<tr align="center" valign="middle">
<td colspan="6"> </td>
</tr>
</table>
<p class="gr"><strong></strong></p><p> </p></td>
</tr>
<tr>
<td height="1" colspan="2" class="bgbl"></td>
</tr>
</table></td>
</tr>
<asp:GridView ID="gvUploadFiles" ClientIDMode="Static" onRowCommand="gvUploadFiles_Clicked" DataKeyNames="FileID,FileName,FileSize,FilePath,Status" AllowPaging="false" runat="server"
PagerStyle-HorizontalAlign="Center" AutoGenerateColumns="false" Width="90%"
CellPadding="0" BorderWidth="0" AlternatingRowStyle-BorderColor="LightGray" AlternatingRowStyle-BorderWidth="1" GridLines="None" ShowHeader="true" AlternatingRowStyle-BackColor="#f9f9f9" >
<Columns>
<asp:ImageField DataImageUrlField="ThumbanilPath" HeaderText="Thumbnail" ItemStyle-CssClass="alignmentCenter" ControlStyle-Width="100px" ControlStyle-Height="100px" runat="server"></asp:ImageField>
<asp:BoundField DataField="FileName" ItemStyle-CssClass="alignmentCenter" HeaderText="File Name" />
<asp:BoundField DataField="FileSize" ItemStyle-CssClass="alignmentCenter" HeaderText="File Size" />
<asp:TemplateField>
<ItemTemplate>
<asp:HiddenField ID="filePaths" Value="FilePath" runat="server"/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton CommandName="doingUpload" ItemStyle-CssClass="alignmentRight" class="btnStart" CommandArgument='<%#Container.DisplayIndex%>' ID="imgBtnStart" ImageUrl="~/images/start2.gif" runat="server" /></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="imgBtnCancel" ItemStyle-CssClass="alignmentLeft" CommandName="cancelUploading" CommandArgument='<%#Container.DisplayIndex%>' ImageUrl="~/images/cancel2.gif" runat="server" /></ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton CommandName="deleteFile" ItemStyle-CssClass="alignmentRight" Visible="false" id="imgBtnDelete" CommandArgument='<%#Container.DisplayIndex%>' runat="server" ImageUrl="~/images/delete2.gif"></asp:ImageButton>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox Visible="false" ID="chckBoxDelete" ItemStyle-CssClass="alignmentLeft" class="deleteChkBox" ClientIDMode="Static" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:HiddenField ID="uploadStatus" Value="Status" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="FileID" Visible="false" />
</Columns>
</asp:GridView>
<div id="UploadControl1">
<asp:Button ID="Button17" runat="server" Style="display: none;" />
<asp:ModalPopupExtender ID="ModalPopupUploadControl" BehaviorID="ModalPopupUploadControl" runat="server" CancelControlID="ImageButton4"
TargetControlID="btnAddFiles" PopupControlID="Panel5" PopupDragHandleControlID="PopupHeader"
Drag="true" BackgroundCssClass="Overlay">
<Animations>
<OnShown>
<FadeIn Duration=".50" Fps="10" />
</OnShown>
</Animations>
</asp:ModalPopupExtender>
<asp:Panel ID="Panel5" runat="server" class="PopUpPanel"
style="display: none;overflow:hidden; height:100px; width:300px;"><!---unique css-->
<asp:Panel ID="panel7" runat="server" class="closeButton">
<asp:ImageButton ID="ImageButton4" runat="server" ImageUrl="~/images/cross.png"
/>
</asp:Panel>
<div id="uploadControl" class="all">
<div></div>
<asp:FileUpload ID="uploadingFiles" ClientIDMode="Static" runat="server" class="all" style="display:none;" /><br /><br />
<asp:ImageButton ID="imgBtnAddFile" ClientIDMode="Static" runat="server" ImageUrl="~/images/addToGrid.jpg" OnClick="btnAddToList_Click" style="Display:none;" class="all"/>
</div>
<div>
</div>
</asp:Panel>
</div>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="imgBtnAddFile" />
<asp:AsyncPostBackTrigger ControlID="gvUploadFiles" EventName="RowCommand" />
</Triggers>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="gvUploadFiles" EventName="RowCommand" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdateProgress ID="testing" DisplayAfter="0" AssociatedUpdatePanelID="updtPanel" runat="server">
<ProgressTemplate>
<div style=" left:0px; top:0px; position:fixed; width:100%; height:100%;
background-color:White; filter:alpha(opacity=90);opacity:0.9;">
<asp:Image ID="Image2" style="margin-left:500px; margin-top:300px;" ImageUrl="~/images/ajax-loader.gif" runat="server" />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<tr>
<td align="right"><img src="../images/m7.gif" width="115" height="26" /></td>
</tr>
</table>
</asp:Panel>
</div>

collapsiblepanel collapse in code not collapsing

I have a panel that i have extended with collapsible extender. It is working perfectly until i try to collapse it by code.
The collapsible panel is shown inside a modal popup where user searches for some data, that is
shown in a grid , In every row of grid there is a select button that fires the row command event of the grid on which i am trying to close the panel.
Markup:
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btnAdd"
PopupControlID="pnlpopup" CancelControlID="Cancel" BackgroundCssClass="modalBackground">
</asp:ModalPopupExtender>
<asp:Panel ID="pnlpopup" runat="server" BackColor="White" Height="320px" Width="530px"
Style="display: none">
<table width="100%" style="border: Solid 3px #D55500; height: 100%" cellpadding="0"
cellspacing="0">
<tr>
<td>
Bridge ID :
<asp:TextBox ID="txtID" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvID" runat="server" ControlToValidate="txtID" ValidationGroup="vldAddBridge"
ErrorMessage="Please enter ID" ForeColor="Red"></asp:RequiredFieldValidator>
</td>
<td>
Bridge Name :
<asp:TextBox ID="txtBridgeName" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvBridgeName" runat="server" ControlToValidate="txtBridgeName"
ValidationGroup="vldAddBridge" ErrorMessage="Please enter bridge name." ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
<td colspan="2" style="text-align: right; margin-left: 40px;">
<asp:Button ID="btnSearchUser" runat="server" OnClick="btnSearchUser_Click" TabIndex="5"
Text="Search" ValidationGroup="vgSearchMember" />
</td>
</tr>
<tr>
<td colspan="5" style="background-color: White" class="style6">
<asp:Label ID="lblSearchResults" runat="server"></asp:Label>
<asp:GridView ID="gvSearchResults" runat="server" AllowPaging="True" AutoGenerateColumns="False"
BackColor="White" BorderWidth="1px" CellPadding="4" CssClass="gridviewBorder"
DataKeyNames="EmpId" ForeColor="Black" GridLines="Horizontal" PageSize="5" RowStyle-CssClass="style5"
TabIndex="7" Width="100%" OnPageIndexChanging="gvSearchResults_PageIndexChanging"
OnRowCommand="gvSearchResults_RowCommand">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkSelect" runat="server" Text="Select" CommandName="Select"
CommandArgument='<%# Eval("EmpId") %>'></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="EmpId" HeaderText="Employee ID" />
<asp:BoundField DataField="Alias" HeaderText="Username" />
<asp:BoundField DataField="FirstName" HeaderText="First Name" />
<asp:BoundField DataField="LastName" HeaderText="Last Name" />
</Columns>
</asp:GridView>
<br />
</td>
</tr>
</table>
</asp:Panel>
<asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server" CollapseControlID="btnOwner"
ExpandControlID="btnOwner" TargetControlID="PnlRegister" Collapsed="true">
</asp:CollapsiblePanelExtender>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<br />
<asp:Button ID="btnSaveBridge" runat="server" Text="Save" OnClick="btnSaveBridge_Click"
ValidationGroup="vldAddBridge" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click" />
<span style="display: none">
<input type="button" id="Cancel" /></span>
</td>
</tr>
</table>
</asp:Panel>
Code:
protected void gvSearchResults_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Select")
{
//some business logic
CollapsiblePanelExtender1.Collapsed = true;
ModalPopupExtender1.Show();
}
}
It is not working the panel is always open ?? Any suggestions.....
You are missing
tr in your design. Please check it
Markup:
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="btnAdd"
PopupControlID="pnlpopup" CancelControlID="Cancel" BackgroundCssClass="modalBackground">
</asp:ModalPopupExtender>
<asp:Panel ID="pnlpopup" runat="server" BackColor="White" Height="320px" Width="530px"
Style="display: none">
<table width="100%" style="border: Solid 3px #D55500; height: 100%" cellpadding="0"
cellspacing="0">
<tr>
<td>
Bridge ID :
<asp:TextBox ID="txtID" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvID" runat="server" ControlToValidate="txtID" ValidationGroup="vldAddBridge"
ErrorMessage="Please enter ID" ForeColor="Red"></asp:RequiredFieldValidator>
</td>
<td>
Bridge Name :
<asp:TextBox ID="txtBridgeName" runat="server"></asp:TextBox>
<asp:RequiredFieldValidator ID="rfvBridgeName" runat="server" ControlToValidate="txtBridgeName"
ValidationGroup="vldAddBridge" ErrorMessage="Please enter bridge name." ForeColor="Red"></asp:RequiredFieldValidator>
</td>
</tr>
**<tr> //This is missing**
<td colspan="2" style="text-align: right; margin-left: 40px;">
<asp:Button ID="btnSearchUser" runat="server" OnClick="btnSearchUser_Click" TabIndex="5"
Text="Search" ValidationGroup="vgSearchMember" />
</td>
</tr>
<tr>
<td colspan="5" style="background-color: White" class="style6">
<asp:Label ID="lblSearchResults" runat="server"></asp:Label>
<asp:GridView ID="gvSearchResults" runat="server" AllowPaging="True" AutoGenerateColumns="False"
BackColor="White" BorderWidth="1px" CellPadding="4" CssClass="gridviewBorder"
DataKeyNames="EmpId" ForeColor="Black" GridLines="Horizontal" PageSize="5" RowStyle-CssClass="style5"
TabIndex="7" Width="100%" OnPageIndexChanging="gvSearchResults_PageIndexChanging"
OnRowCommand="gvSearchResults_RowCommand">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkSelect" runat="server" Text="Select" CommandName="Select"
CommandArgument='<%# Eval("EmpId") %>'></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="EmpId" HeaderText="Employee ID" />
<asp:BoundField DataField="Alias" HeaderText="Username" />
<asp:BoundField DataField="FirstName" HeaderText="First Name" />
<asp:BoundField DataField="LastName" HeaderText="Last Name" />
</Columns>
</asp:GridView>
<br />
</td>
</tr>
</table>
</asp:Panel>
<asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server" CollapseControlID="btnOwner"
ExpandControlID="btnOwner" TargetControlID="PnlRegister" Collapsed="true">
</asp:CollapsiblePanelExtender>
</td>
</tr>
<tr>
<td align="center" colspan="2">
<br />
<asp:Button ID="btnSaveBridge" runat="server" Text="Save" OnClick="btnSaveBridge_Click"
ValidationGroup="vldAddBridge" />
<asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClick="btnCancel_Click" />
<span style="display: none">
<input type="button" id="Cancel" /></span>
</td>
</tr>
</table>
</asp:Panel>
Hope it solve your problem

Modalpopup wont close when dropdown is selected

I've been having this odd issue with modal popups. For some reason when I choose a dropdown item my update button wont fire a click event. but then I leave the dropdown at their default values the update button works just fine.
here's my aspx page code
<asp:Button ID="Button1" CssClass="hide" runat="server" Text="Button" />
<ajaxToolkit:ModalPopupExtender runat="server" ID="cfPopUp" PopupControlID="Panel4"
TargetControlID="Button1" OkControlID="cfUpdateBtn" CancelControlID="cfCancelBtn" />
<asp:Panel ID="Panel4" runat="server" CssClass="modalPopup">
<asp:UpdatePanel ID="UpdatePanel2" runat="Server">
<ContentTemplate>
<asp:Panel ID="Panel13" CssClass="" runat="server">
<asp:Panel ID="Panel14" CssClass="" runat="server">
<div style="padding: 10px; border: 3px solid black; background-color: White; color: Black;">
<asp:Label ID="Label25" Width="200px" runat="server" Text="Health and Safety Net" /><div
class="seperator">
</div>
<table class="style143">
<tr>
<td class="style185">
<asp:Label ID="cfCategorylbl" runat="server" Text="Category:"></asp:Label>:
</td>
<td>
<asp:DropDownList ID="cbFactors_Categories" runat="server" Width="350px" Font-Names="Tahoma"
Font-Size="Small" ForeColor="DimGray" Height="24px" CssClass="style75">
</asp:DropDownList>
<ajaxToolkit:CascadingDropDown ID="CascadingDropDown3" runat="server" TargetControlID="cbFactors_Categories"
Category="categories" ServiceMethod="getCategory" ServicePath="~/2012/IrSubmitWebService.asmx"
PromptText="Select Category" />
</td>
<td align="center" rowspan="3" valign="top">
<asp:Label ID="lblFactor_ID" runat="server" Font-Names="Tahoma" Font-Size="Small"
ForeColor="DimGray" Style="font-style: italic" TabIndex="56"></asp:Label>
<cc1:DynamicPopulateExtender ID="lblFactor_ID_DynamicPopulateExtender" runat="server"
Enabled="True" TargetControlID="lblFactor_ID" BehaviorID="dp1" ServiceMethod="getFactorID"
ServicePath="~/2012/IrSubmitWebService.asmx">
</cc1:DynamicPopulateExtender>
<hr class="style157" />
<asp:Label ID="cfID" runat="server" Font-Names="Tahoma" Font-Size="Small" ForeColor="DimGray"
Style="font-style: italic" Width="400px" TabIndex="57"></asp:Label>
</td>
</tr>
<tr>
<td class="style185">
<asp:Label ID="cfTypeslbl" runat="server" Text="Type:"></asp:Label>
</td>
<td>
<asp:DropDownList ID="cbFactors_Types" runat="server" ForeColor="DimGray" Height="24px"
TabIndex="54" Width="350px" Font-Names="Tahoma" Font-Size="Small" CssClass="style75">
</asp:DropDownList>
<cc1:CascadingDropDown ID="cbFactors_Types_CascadingDropDown" runat="server"
TargetControlID="cbFactors_Types" ParentControlID="cbFactors_Categories" Category="type"
ServiceMethod="getTypeofAction" ServicePath="~/2012/IrSubmitWebService.asmx"
PromptText="Select Type">
</cc1:CascadingDropDown>
</td>
</tr>
<tr>
<td class="style185">
<asp:Label ID="cfFactorslbl" runat="server" Text="Factor:"></asp:Label>
</td>
<td>
<asp:DropDownList ID="cbFactors_Factors" runat="server" ForeColor="DimGray" Height="24px"
TabIndex="55" Width="350px" Font-Names="tahoma" Font-Size="Small" CssClass="style75">
</asp:DropDownList>
<cc1:CascadingDropDown ID="cbFactors_Factors_CascadingDropDown" runat="server"
TargetControlID="cbFactors_Factors" ParentControlID="cbFactors_Types" Category="category"
ServiceMethod="getFactor" ServicePath="~/2012/IrSubmitWebService.asmx" PromptText="Select Factor">
</cc1:CascadingDropDown>
</td>
</tr>
<tr>
<td class="style185">
<asp:Label Text="Justification:" ID="cfJustificationlbl" runat="server"></asp:Label>
</td>
<td colspan="2">
<asp:TextBox ID="txtJustification" runat="server" ForeColor="DimGray" Height="29px"
Style="font-family: Tahoma; font-size: small" TabIndex="56" TextMode="MultiLine"
ToolTip="Provide a justification for this factor." Width="775px" Font-Names="Tahoma"
Font-Size="Small"></asp:TextBox>
</td>
</tr>
</table>
<br />
<div style="text-align: center">
<asp:Button CausesValidation="false" ID="cfUpdateBtn" runat="server"
Text="Update" CssClass="button" /><span style="margin-left: 10px"><asp:Button CausesValidation="false"
ID="cfCancelBtn" runat="server" Text="Cancel" CssClass="button" /></span></div>
</div>
</asp:Panel>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
and my code behind for my update (it just closes the popup)
Protected Sub cfUpdateBtn_Click(sender As Object, e As EventArgs) Handles cfUpdateBtn.Click
cfPopUp.Hide()
End Sub
For the life of me I can't figure out why the update button wont work when the dropdowns are not the default value.
Thanks for your help guys
The possible reason may be you are binding your dropdownlist with a webservice. Whenever you click to an item on dropdownlist webservice may be called. If webservice is called then may be your page again loaded ? I don't know the exact reason why it is not working. You have to check the service behavior what happened when the service is called.
I basically rebuilt my modal popup and update panel like so
<asp:Panel ID="pnlEditPopup" runat="server" CssClass="modalPopup">
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<ContentTemplate>
<asp:Panel ID="pnlEditPopupContent" runat="server">
<div style="padding: 10px; border: 3px solid black; background-color: White; color: Black;">
<table cellpadding="0" cellspacing="4" border="0">
<tr>
<td class="name">Category:</td>
<td class="value">
<asp:DropDownList id="ddCat" runat="server">
<asp:listitem value="">No Selection</asp:listitem>
<asp:listitem value="Action">Action</asp:listitem>
<asp:listitem value="Worksite">Worksite</asp:listitem>
<asp:listitem value="Human Factors">Human Factors</asp:listitem>
<asp:listitem value="System Factors">System Factors</asp:listitem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="name">Type:</td>
<td class="value">
<asp:DropDownList id="ddType" runat="server" />
<ajaxToolkit:CascadingDropDown ID="ccType" runat="server"
TargetControlID="ddType"
ParentControlID="ddCat"
PromptText="No Selection"
LoadingText="Please Wait..."
ServicePath="~/2012/IrSubmitWebService.asmx"
ServiceMethod="getTypeofAction"
Category="Other"
/>
</td>
</tr>
<tr>
<td class="name">Factor:</td>
<td class="value">
<asp:DropDownList id="ddfactor" runat="server" />
<ajaxToolkit:CascadingDropDown ID="ccFactor" runat="server"
TargetControlID="ddfactor"
ParentControlID="ddType"
PromptText="No Selection"
LoadingText="Please Wait..."
ServicePath="~/2012/IrSubmitWebService.asmx"
ServiceMethod="getFactor"
Category="Other"
/>
</td>
</tr>
<tr>
<td>
Justification:
<asp:Label ID="factorID" runat="server" Visible="false"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtJustification" runat="server" ForeColor="DimGray" Height="100px"
Style="font-family: Tahoma; font-size: small" TabIndex="56" TextMode="MultiLine"
ToolTip="Provide a justification for this factor." Width="300px" Font-Names="Tahoma"
Font-Size="Small"></asp:TextBox>
</td>
</tr>
<tr>
<td>
Factor ID<br />
and Description:
</td>
<td>
<asp:Label ID="factor_id_Desc" runat="server" Width="300px" Font-Names="Tahoma" Font-Size="Small"
ForeColor="DimGray" TabIndex="56"></asp:Label>
<cc1:DynamicPopulateExtender ID="DynamicPopulateExtender1" runat="server"
Enabled="True" TargetControlID="factor_id_Desc" BehaviorID="dp1" ServiceMethod="getFactorID"
ServicePath="~/2012/IrSubmitWebService.asmx">
</cc1:DynamicPopulateExtender>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<asp:Button ID="btnOkEditPopup" runat="server" Text="Ok" CssClass="button"/>
<span style="margin-left:10px"><asp:button id="btnCancelEditPopup" runat="server" text="Cancel" CssClass="button"/></span>
</td>
</tr>
</table>
</div>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<ajaxToolkit:ModalPopupExtender ID="mpeEdit" runat="server"
TargetControlID="btnOpenEditPopup"
PopupControlID="pnlEditPopup"
/>
Fixed my issue. I still dont know why it wasn't working when I asked the question but I was able to solve it. Thanks to all who looked into it for me.

Resources