<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.
Related
I have an update panel that includes a gridview with two buttons and a modal popup. When the user clicks btnView, the modal popup appears displaying the relevant information.
My issue is that I have been trying to get the updateprogress to appear during the partial postback and so far have not managed it. I should mention that the same UpdateProgress code does work in a test page that just comprises of a button with a sleep function in the code behind. Here is the html:
<!-- Placing the GridView in UpdatePanel-->
<asp:UpdatePanel ID="UpdatePanel1" runat="server" ChildrenAsTriggers="false" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="gv" />
</Triggers>
<ContentTemplate>
<asp:GridView ID="gv" runat="server" AutoGenerateColumns="False" DataKeyNames="GroupID" GridLines="Both"
BorderWidth="1px" CellPadding="2" ForeColor="Black" OnRowDataBound="gv_RowDataBound" BorderStyle="Double" HorizontalAlign="Center"
HeaderStyle-HorizontalAlign="Center" AllowSorting="True" CssClass="gvformat">
<AlternatingRowStyle BackColor="#95B9B9" />
<HeaderStyle BorderStyle="Double" BorderColor="Black"/>
<Columns>
<asp:BoundField DataField="FinancialYear" HeaderText="Financial Year" ItemStyle-HorizontalAlign="Center"/>
<asp:TemplateField ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Button ID="btnView" runat="server" Text="view" OnClick="btnComments_Click" CausesValidation="false" Font-Names="Trebuchet MS" CssClass="btn btn-info" Font-Bold="True" />
</ItemTemplate>
<HeaderTemplate>Comment</HeaderTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle">
<ItemTemplate>
<asp:Button ID="btnDetail" runat="server" Text="view" OnClick="btnDetails_Click" CausesValidation="false" Font-Names="Trebuchet MS" CssClass="btn btn-comment" ForeColor="White" Font-Bold="True" />
</ItemTemplate>
<HeaderTemplate>Details</HeaderTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Button ID="bttnHidden" runat="Server" Style="display: none" />
<br />
<asp:Panel ID="pnlComment" runat="server" Width="650px" Height="620px" Style="display: none;" CssClass="modalBox">
<table border="1" class="commentTable" style="border-collapse: separate; border-spacing: 10px; width:100%; height:100%">
<tr><th><asp:Label ID="lblComments" runat="server" Text="Comments" Font-Size="Medium"></asp:Label></th></tr>
<tr><td>
<asp:TextBox ID="txtExistingComments" runat="server" TextMode="MultiLine" ReadOnly="True" CssClass="content" Rows="12" Font-Names="Trebuchet MS"></asp:TextBox>
</td></tr>
<tr><th><asp:Label ID="lblNewComment" runat="server" Text="Add Comment" Font-Size="Medium"></asp:Label></th></tr>
<tr><td>
<asp:TextBox ID="txtNewComments" runat="server" TextMode="MultiLine" ReadOnly="False" CssClass="content" Rows="12" Font-Names="Trebuchet MS"></asp:TextBox></td></tr>
<tr><td>
<asp:Button ID="btnSave" runat="server" width="100px" Text="Save" OnClick="btnSave_Click" CssClass="btn btn-comment" ValidationGroup="SaveComment" ForeColor="White" Font-Bold="True" />
<asp:Button ID="btnCancel" runat="server" width="100px" Text="Cancel" CssClass="btn btn-comment" ForeColor="White" Font-Bold="True"/></td></tr>
<tr>
<td>
<asp:RequiredFieldValidator ID="rfValidator" runat="server" ErrorMessage="RequiredFieldValidator" ControlToValidate="txtNewComments"
ForeColor="Black" ValidationGroup="SaveComment" Font-Bold="True">You must enter a comment!</asp:RequiredFieldValidator>
</td>
</tr>
</table>
</asp:Panel>
<cc1:ModalPopupExtender ID="modal" runat="server" TargetControlID="bttnHidden" PopupControlID="pnlComment" CancelControlID="btnCancel" BackgroundCssClass="modalBackground"></cc1:ModalPopupExtender>
<br />
<asp:HiddenField ID="Hidden" runat="server" value="-1"/>
<asp:HiddenField ID="bStatus" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1" ChildrenAsTriggers="false" UpdateMode="Conditional" DisplayAfter="10">
<ProgressTemplate>
<div class="center">
<asp:Image ID="imgUpdateProgress" runat="server" ImageUrl="~/Images/loader.gif" AlternateText="Please wait ..." ToolTip="Please wait ..." />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
</asp:Content>
Any help would be most appreciated!
two points you need to check.
First if you have any javascript errors - this Update Progress is base on javascrip, so any javascript error can stop the function of it. Open the console panel and check for javascript errors...
The second point is to check the DisplayAfter property on UpdateProgress, that is 500 milliseconds default value. If anything happens within this time, the UpdateProgress is not show. So add a lower value on DisplayAfter to check it out.
I have a gridview in which one of the column contains radio button. which i have placed inside item template. I want to trigger async callback to a panel in which i have a grid. this complete page is a user control.
When i am unable to add the trigger
<asp:GridView ID="grdBalStatus" runat="server" AutoGenerateColumns="false" Width="100%">
<HeaderStyle CssClass="dlresultheader" />
<RowStyle CssClass="griditems" />
<Columns>
<asp:BoundField DataField="TerminalId" HeaderStyle-Width="35%" />
<asp:BoundField DataField="Description"></asp:BoundField>
<asp:TemplateField HeaderStyle-Width="65%" HeaderText="Auto/Full Balancing Status">
<HeaderTemplate>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="right" style="width: 32%">
<%--<asp:Label ID="lblSelAll" runat="server" CssClass="autoresultheader" Text="All:"></asp:Label>--%>
</td>
<td align="left" style="width: 60%">
<asp:RadioButton ID="rdAllAuto" runat="server" CssClass="autoresultheader" GroupName="AutoorFull1"
Text="Auto" ToolTip="Select auto balancing for all Self-Checkouts" />
<asp:RadioButton ID="rdAllFull" runat="server" CssClass="autoresultheader" GroupName="AutoorFull1"
Text="Full" ToolTip="Select full balancing for all Self-Checkouts" />
</td>
<td style="width: 8%">
</td>
</tr>
</table>
</HeaderTemplate>
<ItemTemplate>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="right" style="width: 32%">
<asp:Label runat="server" ID="TermId" Text='<%# Eval("TerminalId") %>' CssClass="hide"></asp:Label>
</td>
<td align="left" style="width: 60%">
<asp:RadioButton ID="rdAuto" runat="server" CssClass="fullgriditems" GroupName="AutoorFull"
Text="Auto" />
<asp:RadioButton ID="rdFull" runat="server" CssClass="fullgriditems" GroupName="AutoorFull"
AutoPostBack="true" OnCheckedChanged="rdFull_CheckedChanged" Text="Full" />
</td>
<td style="width: 8%">
<%--<asp:Label runat="server" ID="Version" Text='<%# Eval("TerminalVersion") %>' CssClass="hide"></asp:Label> --%>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="TerminalVersion"></asp:BoundField>
</Columns>
</asp:GridView>
Code in the update panel
<asp:UpdatePanel ID="upFullBalTerm" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="rdFull" EventName="CheckedChanged" />
</Triggers>
<ContentTemplate>
<table width="100%">
<tr id="trFullBalTl" class="hide" runat="server">
<td style="padding-top: 5px;" id="tdFullBalTerminal">
<asp:GridView runat="server" ID="grdFullBalTerminal" AutoGenerateColumns="false" Width="80%" BorderStyle="None" ShowHeader="true">
<HeaderStyle CssClass="dlresultheader" Width="15%" Height="30" />
<RowStyle CssClass="griditems" VerticalAlign="Bottom" />
<EmptyDataTemplate></EmptyDataTemplate>
<Columns>
<asp:TemplateField HeaderText="Terminal Id">
<HeaderStyle Width="12%" BorderStyle="None" />
<ItemStyle BorderStyle="none" CssClass="dlresultheader" />
<ItemTemplate>
<asp:Label runat="server" ID="lblFullBalTlId" Text='<%# Eval("terminal") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
Please suggest how to write the trigger.
I used a hidden button which is the trigger for the update panel. On click event of the radio button i called button click event using javascript.
I have a GridView which charge user data, selecting one lifts the panel through a ModalPopupExtender, this panel has UpdatePanel nested as you can see in the code, pressing the save button closes the Popup, can not find the error. help me with this problem.
Removing the UpdatePanel not let the FileUpload upload the file but no longer the Popup is closed, but I need to upload the file and that the Popup is not closed.
<asp:Panel ID="pDatos" runat="server" BackColor="#E0E0E0">
<table>
<tr>
<td>
<asp:GridView runat="server" ID="gvResultado" AutoGenerateColumns="false"
OnRowCommand="gvResultado_OnRowCommand" DataKeyNames="Id, Estado" >
<Columns>
<asp:ButtonField DataTextField="Id" ItemStyle-ForeColor="Black"
ControlStyle-CssClass="hover" CommandName="gvResultado"
HeaderText="Verificar"/>
<asp:BoundField DataField="Nombre" HeaderText="Nombre" ItemStyle-Width="320px" />
<asp:BoundField DataField="Observaciones" HeaderText="Observaciones" ItemStyle-Width="360px" />
<asp:BoundField DataField="Fecha" HeaderText="Fecha" />
<asp:BoundField DataField="Estado" HeaderText="Estado" ItemStyle-Width="120px" />
</Columns>
</asp:GridView>
</td>
</tr>
</table>
</asp:Panel>
<asp:HiddenField ID="hfPopup" runat="server" />
<ajax:ModalPopupExtender ID="mpePopup" runat="server" PopupControlID="pPopup"
TargetControlID="hfPopup" BackgroundCssClass="backgroundColor">
</ajax:ModalPopupExtender>
<asp:Panel ID="pPopup" runat="server" BackColor="#CFCFCF" Style="display: none" >
<asp:UpdatePanel ID="upPopup" runat="server">
<ContentTemplate>
<table style="width:740px;" align="center">
<tr>
<td align="center" colspan="2">
<asp:GridView runat="server" ID="gvHistorial" AutoGenerateColumns="false"
OnRowCommand="gvHistorial_RowCommand" DataKeyNames="Descargar" >
<Columns>
<asp:BoundField DataField="Legajo" HeaderText="Legajo" ItemStyle-Width="100"/>
<asp:BoundField DataField="Observaciones" HeaderText="Observaciones" ItemStyle-Width="550" />
<asp:BoundField DataField="Fecha" HeaderText="Fecha" ItemStyle-Width="150"/>
<asp:ButtonField DataTextField="Descargar" HeaderText="Descargar" CommandName="gvHistorial_Descargar" />
</Columns>
</asp:GridView>
</td>
</tr>
<tr>
<td><!-- --></td>
<td >
<asp:UpdatePanel ID="upArchivo" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:FileUpload ID="luSeleccione" runat="server" />
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="bGuardar" />
</Triggers>
</asp:UpdatePanel>
</td>
</tr>
<tr>
<td><!-- --></td>
<td align="left">
<asp:Button runat="server" ID="btnGuardar" OnClick="btnGuardar_Click"
Text="Guardar" CssClass="Button hover" />
<asp:Button runat="server" ID="btnSalir" OnClick="btnSalir_Click"
Text="Salir" CssClass="Button hover" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
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
I have a DataList that has a link button and I want this link button envoke a modal popup. I've copied the mpe code from another application where it works in a gridview. The error is thrown as soon as page is openned and each time the link button is clicked. The error is thrown in the ScriptResource file: "Microsoft JScript runtime error: Sys.ArgumentNullException: Value cannot be null.
Parameter name: elements". I understand something has null value but not sure what. Page has over a thousand lines so I'll just paste the part I'm working on.
<ItemTemplate>
<tr class="AssetMngnt-trHeaderRow_bgColor">
<td valign="top">
<asp:Label ID="lblIdent" runat="server" Text='<%# Eval("Printer_Ident") %>' Visible="false"></asp:Label>
</td>
<td>
<asp:LinkButton ID="lbEdit" runat="server" CausesValidation="False" CommandName="Select" Text="Edit" />
</td>
<td valign="top" nowrap>
<asp:Label ID="lblName" Text='<%# Eval("Network_Name") %>' runat="server" />
</td>
<td valign="top">
<asp:LinkButton ID="lbPrinterModel"
runat="server" CausesValidation="False" CommandName="Select" CommandArgument="ShowAsset"
Text='<%# Eval("Printer_Mfg") + " " + (string)Eval("Printer_Model") %>' />
</td>
<td valign="top">
<asp:Label ID="lblLocation" Text='<%# Eval("Location") %>' runat="server" />
</td>
<td>
<asp:LinkButton ID="LinkButton1"
runat="server" CausesValidation="False" CommandName="Select" CommandArgument="IssueToners"
Text="Issue Toners" />
<asp:Button runat="server" ID="btnShowPopup" style="display:none" />
<ajaxToolkit:ModalPopupExtender runat="server" id="mpeIssueToners"
TargetControlID="btnShowPopup"
PopupControlID="pnlFvIssueTonersModal"
CancelControlID="UpdateCancelButton"
BackgroundCssClass="modalBackground" >
</ajaxToolkit:ModalPopupExtender>
</td>
</tr>
</ItemTemplate>
<asp:Panel runat="server" ID="pnlFvIssueTonersModal" Visible="true" style="display:none">
<asp:Panel runat="server" ID="pnlFvIssueToners" Visible="true">
<div id="AssetMngnt-FloatLeft_alt"">
<!-- ISSUE TONERS FORM VIEW ******************************************************************************** -->
<asp:FormView ID="fvIssueCartridges" runat="server" DataSourceID="ODSIssueCartridges"
OnItemUpdating="fvIssueCartridges_OnItemUpdating" OnItemUpdated="FormView1_Display_Update_Msg"
EnableViewState="False"
EmptyDataRowStyle-CssClass="AssetMngnt-panelRO" >
<EditItemTemplate>
</EditItemTemplate>
</asp:FormView>
<!-- END ISSUE TONERS FORM VIEW **************************************************************************** -->
</div>
</asp:Panel>
<ajaxToolKit:ModalPopupExtender ID="ModalPopupExtender1" BehaviorID="mdlPopup" runat="server"
TargetControlID="div" PopupControlID="div" CancelControlID="btnNo"
OnCancelScript="cancelClick();" BackgroundCssClass="modalBackground" />
<div id="div" runat="server" align="center" class="confirm" style="display:none">
<asp:Label Text="Form is empty - empty records are not allowed."
ForeColor="#000000" runat="server" ID="Label3" /><br />
<asp:Button ID="btnNo" runat="server" Text="Ok" Width="50px" />
</div>
</asp:Panel>
The ModalPopupExtender1 takes care of things inside the FormView.
Thanks,
Risho