Calling user control within a user control - c#

Hi I have two usercontrols.
The first user control has a button and the second user control has a popup control.
I registered the second user control in the first user control with id=ctlPopUp
Onclick event of button I have to display the popup control.
I tried with
protected void btnUser_Click(object sender, EventArgs e)
{
var userCtlPopup = ctlPopUp.FindControl("pcDownload");
userCtlPopup.Visible = true;
}
It doesn't work. Can you please suggest?
Hi here is the user control markups:
POpupUsercontrol:
<div id="divDownload" runat="server" visible="true">
<dx:aspxpopupcontrol id="pcDownload" runat="server" showpagescrollbarwhenmodal="true"
clientinstancename="pcDownload" enableclientsideapi="true" modal="True" popuphorizontalalign="WindowCenter"
popupverticalalign="WindowCenter" showheader="false" allowdragging="True" enableanimation="False"
enableviewstate="False" width="600px" autoupdateposition="true" closeaction="CloseButton">
<ContentCollection>
<dx:PopupControlContentControl ID="PopupControlContentControl4" runat="server"
Width="100%">
<dx:ASPxPanel ID="ASPxPanel3" runat="server">
<PanelCollection>
<dx:PanelContent ID="PanelContent4" runat="server">
<div>
<table class="cChildTable">
<tr>
<td>
<h3>Download</h3>
</td>
</tr>
<tr>
<td class="auto-style1">
<div class="hr">
</div>
<asp:Label ID="lblDownLoadMessages" runat="server" CssClass="cMessageArea"></asp:Label>
</td>
</tr>
</table>
<table class="cChildTable" border="0">
<tr><td style="font:bold" colspan="2"><asp:Label ID="Title" runat="server" Text="Content Link Title"></asp:Label></td></tr>
<tr>
<td style="vertical-align: top; width: 30px; padding: 2px" rowspan="8">
<asp:CheckBox ID="chkImg" runat="server" AutoPostBack="True" Checked="true" />
</td>
<td style="vertical-align: top" rowspan="3">
<asp:Image runat="server" ID="imgUpload" Width="100px" Height="100px" Style="top: 0px;" AlternateText="No Image" />
</td>
<td>
<asp:CheckBox ID="chkName" runat="server"
AutoPostBack="true" />
</td>
<td class="cLabel" style="width: 15%">
<asp:Label ID="lblName" runat="server" Text="Name:" Width="90px"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtName" runat="server" CssClass="cText" Width="300px" MaxLength="75"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:CheckBox ID="chkCompany" runat="server"
AutoPostBack="true" />
</td>
<td class="cLabel" style="width: 15%">
<asp:Label ID="lblCompany" runat="server" Text="Company:" Width="90px"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtCompany" runat="server" CssClass="cText" Width="300px" MaxLength="75"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:CheckBox ID="chkAddress" runat="server"
AutoPostBack="true" />
</td>
<td class="cLabel" style="width: 15%">
<asp:Label ID="lblAddress" runat="server" Text="Address:" Width="90px"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtAddress" runat="server" CssClass="cText" Width="300px" MaxLength="75"></asp:TextBox>
</td>
</tr>
<tr>
<td rowspan="5" style="vertical-align:top"><asp:LinkButton ID="lnkAddImg" runat="server"> </asp:LinkButton></td>
<td>
<asp:CheckBox ID="chkCtyStateZip" runat="server"
AutoPostBack="true" />
</td>
<td class="cLabel" style="width: 15%">
<asp:Label ID="lblCtyStateZip" runat="server" Text="City, State Zip:" Width="90px"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtCtyStateZip" runat="server" CssClass="cText" Width="300px" MaxLength="75"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:CheckBox ID="chkPhone" runat="server"
AutoPostBack="true" />
</td>
<td class="cLabel" style="width: 15%">
<asp:Label ID="lblPhone" runat="server" Text="Phone:" Width="90px"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtPhone" runat="server" CssClass="cText" Width="150px" MaxLength="75"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:CheckBox ID="chkFax" runat="server"
AutoPostBack="true" />
</td>
<td class="cLabel" style="width: 15%">
<asp:Label ID="lblFax" runat="server" Text="Fax:" Width="90px"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtFax" runat="server" CssClass="cText" Width="150px" MaxLength="75"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:CheckBox ID="chkEmail" runat="server"
AutoPostBack="true" />
</td>
<td class="cLabel" style="width: 15%">
<asp:Label ID="lblEmail" runat="server" Text="Email:" Width="90px"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtEmail" runat="server" CssClass="cText" Width="150px" MaxLength="75"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:CheckBox ID="chkOther" runat="server"
AutoPostBack="true" />
</td>
<td class="cLabel" style="width: 15%">
<asp:Label ID="lblOther" runat="server" Text="Other:" Width="90px "></asp:Label>
</td>
<td>
<asp:TextBox ID="txtOther" runat="server" CssClass="cText" Width="150px" MaxLength="75"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="4">
<div class="buttons">
<span id="span2" class="cBtnLeft"><span class="cBtnMid"><span class="cBtnRight">
<asp:Button ID="btnDownLoad" runat="server" Width="65px" CssClass="cBtnRight" Text="Download"
OnClick="btnDownLoad_Click"/>
</span></span></span><span id="span1" class="cBtnLeft"><span class="cBtnMid"><span
class="cBtnRight">
<asp:Button ID="btnCancel" runat="server" Width="65px" CssClass="cBtnRight" Text="Cancel"
Visible="true" OnClick="btnCancel_Click" />
</span></span></span>
</div>
</td>
</tr>
</table>
</div>
</dx:PanelContent>
</PanelCollection>
</dx:ASPxPanel>
</dx:PopupControlContentControl>
</ContentCollection>
</dx:aspxpopupcontrol>
</div>
Usercontrol where the popup user control is called
<asp:Panel runat="server" ID="pnlCategoryDetail" Width="100%">
<dx:ASPxDataView ID="dvMARCCategoryDetail" runat="server" Width="100%"
ClientInstanceName="dvMARCCategoryDetail" style="clear: both" ColumnCount="2" RowsPerPage="2" OnPageIndexChanged="dvMARCCategoryDetail_PageIndexChanged">
<itemtemplate>
<table>
<tbody>
<tr>
<td>
<table>
<tr>
<td>
<asp:Image ID="ModelImage" runat="server" ImageUrl='<%#Eval("ImageUrl") %>'>
</asp:Image>
</td>
<td>
<div style="width: 5px" class="Spacer">
</div>
</td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td>
<asp:Label ID="ModelLabel" runat="server" Text='<%# Eval("DocumentName") %>' Font-Bold="True"
>
</asp:Label></td>
</tr>
<tr>
<td style="text-align:left;padding-bottom:1em;">
<asp:Label ID ="txtText1" runat="server" Text="The May edition of News Brief contains seven newsworthy articles"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID ="txtText2" runat="server" Text="Suggested Subject Line: The May 2014 News Brief has arrived!"></asp:Label>
</td>
</tr>
<tr>
<td style="white-space:nowrap;">
<a id="clink2" style="width:60px">Content Link 1</a>
<asp:ImageButton ID="ImageButton2" runat="server" OnClick="btnArrow_Click" ImageUrl="~/Images/DownloadArrow.png" ToolTip="Download Item" style="padding-top:8px"/>
<asp:ImageButton ID="ImageButton1" runat="server" OnClick="btnAdd_Click" ImageUrl="~/Images/Add.png" ToolTip="Add Item" style="padding-top:8px"/>
</td>
<td> </td></tr>
</table>
</td>
</tr>
</tbody>
</table>
</itemtemplate>
<paddings padding="0px" />
<itemstyle height="50px">
</itemstyle>
</dx:ASPxDataView>
</asp:Panel>
<div id="divCategoryPopup" runat="server">
<downloadPopUp:categoryPopup id="ctlPopUp" runat="server"></downloadPopUp:categoryPopup>
</div>
On click of btnArrow_Click the popup user control should be displayed

Related

File Upload Not working in update Panel I also tried triggers but it also not working

File Upload Not working in update Panel I also tried triggers but it also not working KINDLY RESOVE MY ISSUE
***<%# Page Title="Pharmacy Orders" Theme="DefaultTheme" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="OnlinePharmacyOrders.aspx.cs" Inherits="Forms_Online_OnlinePharmacyOrders" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CPH_Header" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="CPH_Menus" runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="CPH_Content" runat="Server">
<asp:UpdatePanel ID="UP_PharmacyOrder" runat="server" ChildrenAsTriggers="True" UpdateMode="Conditional">
<ContentTemplate>
<ProgressTemplate>
<div class="UpdateProgress">
<img src="../../App_Themes/DefaultTheme/Images/loading.gif" alt="" class='loadingImg' />
</div>
</ProgressTemplate>
</asp:UpdateProgress>
<ajax:TabContainer ID="TC_PharmacyOrders" runat="server" ActiveTabIndex="0" AutoPostBack="true">
<ajax:TabPanel ID="TP_Detail" runat="server" TabIndex="1" Visible="false">
<HeaderTemplate>
Detail
</HeaderTemplate>
<ContentTemplate>
<asp:Panel ID="Pnl_UpdateTrackingNo" runat="server" DefaultButton="Btn_UpdateTrackingNo" Visible="False">
<table class="tblListing">
<tr>
<td colspan="2" class="Heading">Order Detail (Update Tracking / Status) </td>
</tr>
<tr>
<td class="shade">Order No</td>
<td>
<asp:Label ID="Lbl_OrderNoT" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td class="shade">Ordered Placed By
</td>
<td>
<asp:Label ID="Lbl_OrderByT" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td class="shade">Contact No
</td>
<td>
<asp:Label ID="Lbl_ContacTNoT" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td class="shade">Invoice No
</td>
<td>
<asp:Label ID="Lbl_InoviceNoT" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td class="shade">Delivery Charges
</td>
<td>
<asp:Label ID="Lbl_DeliveryChargesT" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td class="shade">Invoice Amount
</td>
<td>
<asp:Label ID="Lbl_InvoiceAmountT" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td class="shade">Delivery Address
</td>
<td>
<asp:Label ID="Lbl_DeliveryAddressT" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td class="shade">Pharmacy Remarks
</td>
<td>
<asp:Label ID="Lbl_PharmacyRemarksT" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td class="shade">Status
</td>
<td>
<telerik:RadComboBox ID="Cmb_StatusT" Filter="StartsWith" runat="server" BorderColor="Black" Width="180px" BorderWidth="1px" Skin="Office2010Silver">
<Items>
<telerik:RadComboBoxItem runat="server" Text="Pending" Value="1" />
<telerik:RadComboBoxItem runat="server" Text="Dispatched" Value="2" />
<telerik:RadComboBoxItem runat="server" Text="Cancelled" Value="3" />
<telerik:RadComboBoxItem runat="server" Text="Received by Customer" Value="4" />
<telerik:RadComboBoxItem runat="server" Text="Returned" Value="4" />
</Items>
</telerik:RadComboBox>
</td>
</tr>
<tr>
<td class="shade">Tracking No (if Any)
</td>
<td>
<asp:TextBox ID="TxBx_TrackingNoT" runat="server" ValidationGroup="T"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFV_TrackingNoT" runat="server" ControlToValidate="TxBx_TrackingNoT" Display="None" ErrorMessage="* Required" ValidationGroup="T"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="RFV_TrackingNoT_ValidatorCalloutExtender" runat="server" Enabled="True" TargetControlID="RFV_TrackingNoT">
</ajax:ValidatorCalloutExtender>
<ajax:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" Enabled="True" TargetControlID="RFV_TrackingNo">
</ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td class="shade"> </td>
<td>
<asp:Button ID="Btn_UpdateTrackingNo" runat="server" SkinID="SaveSkin" Text="Save" ValidationGroup="T" Width="100px" OnClick="Btn_UpdateTrackingNo_Click" />
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="Pnl_SaveOrder" runat="server" DefaultButton="Btn_SaveOrder" Visible="False">
<table class="tblListing">
<tr>
<td colspan="2" class="Heading">Order Detail</td>
</tr>
<tr>
<td class="shade">Order No</td>
<td>
<asp:Label ID="Lbl_OrderNo" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td class="shade">Ordered Placed By
</td>
<td>
<asp:Label ID="Lbl_OrderBy" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td class="shade">Contact No
</td>
<td>
<asp:Label ID="Lbl_ContacTNo" runat="server"></asp:Label>
</td>
</tr>
<tr>
<td class="shade">Invoice No
</td>
<td>
<asp:TextBox ID="TxBx_InvoiceNo" runat="server" ValidationGroup="E"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFV_InvoiceNo" runat="server" ControlToValidate="TxBx_InvoiceNo" Display="None" ErrorMessage="* Required" ValidationGroup="E"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="RFV_InvoiceNo_ValidatorCalloutExtender" runat="server" Enabled="True" TargetControlID="RFV_InvoiceNo">
</ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td class="shade">Prescribed By (Consultant/Dr)
</td>
<td>
<asp:TextBox ID="TxBx_ConsultantName" runat="server" ValidationGroup="E"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFV_ConsultantName" runat="server" ControlToValidate="TxBx_ConsultantName" Display="None" ErrorMessage="* Required" ValidationGroup="E"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="VCE_ConsultantName" runat="server" Enabled="True" TargetControlID="RFV_ConsultantName">
</ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td class="shade">Tracking No (if Any)
</td>
<td>
<asp:TextBox ID="TxBx_TrackingNo" runat="server" ValidationGroup="E"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFV_TrackingNo" runat="server" ControlToValidate="TxBx_TrackingNo" Display="None" ErrorMessage="* Required" ValidationGroup="E"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="RFV_TrackingNo_ValidatorCalloutExtender" runat="server" Enabled="True" TargetControlID="RFV_TrackingNo">
</ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td class="shade">Delivery Charges
</td>
<td>
<asp:TextBox ID="TxBx_DeliveryCharges" CssClass="numeric" runat="server" ValidationGroup="E"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFV_DeliveryCharges" runat="server" ControlToValidate="TxBx_DeliveryCharges" Display="None" ErrorMessage="* Required" ValidationGroup="E"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="RFV_DeliveryCharges_ValidatorCalloutExtender" runat="server" Enabled="True" TargetControlID="RFV_DeliveryCharges">
</ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td class="shade">Invoice Amount
</td>
<td>
<asp:TextBox ID="TxBx_InvoiceAmount" runat="server" CssClass="numeric" ValidationGroup="E"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFV_InvoiceAmount" runat="server" ControlToValidate="TxBx_InvoiceAmount" Display="None" ErrorMessage="* Required" ValidationGroup="E"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="RFV_InvoiceAmount_ValidatorCalloutExtender" runat="server" Enabled="True" TargetControlID="RFV_InvoiceAmount">
</ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td class="shade">Delivery Address
</td>
<td>
<asp:TextBox ID="TxBx_DeliverAddress" TextMode="MultiLine" runat="server" Width="400px" Rows="6" ValidationGroup="E"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFV_DeliverAddress" runat="server" ControlToValidate="TxBx_DeliverAddress" Display="None" ErrorMessage="* Required" ValidationGroup="E"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="RFV_DeliverAddress_ValidatorCalloutExtender" runat="server" Enabled="True" TargetControlID="RFV_DeliverAddress">
</ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td class="shade">Pharmacy Remarks
</td>
<td>
<asp:TextBox ID="TxBx_PharmacyRemarks" TextMode="MultiLine" runat="server" Width="400px" Rows="6" ValidationGroup="E"></asp:TextBox>
<asp:RequiredFieldValidator ID="RFV_PharmacyRemarks" runat="server" ControlToValidate="TxBx_PharmacyRemarks" Display="None" ErrorMessage="* Required" ValidationGroup="E"></asp:RequiredFieldValidator>
<ajax:ValidatorCalloutExtender ID="RFV_PharmacyRemarks_ValidatorCalloutExtender" runat="server" Enabled="True" TargetControlID="RFV_PharmacyRemarks">
</ajax:ValidatorCalloutExtender>
</td>
</tr>
<tr>
<td class="shade">Status
</td>
<td>
<asp:DropDownList ID="DDL_Status" runat="server" Width="200px">
<asp:ListItem Text="Pending" Value="1"></asp:ListItem>
<asp:ListItem Text="Dispatched" Value="2"></asp:ListItem>
<asp:ListItem Text="Received" Value="4"></asp:ListItem>
</asp:DropDownList>
</td>
</tr>
</table>
</asp:Panel>
<table class="tblListing">
<tr>
<td class="Heading" colspan="2">Upload Invoice
</td>
</tr>
<tr>
<td class="shade"> Upload Invoice</td>
<td>
<asp:FileUpload ID="File_Uploader" runat="server" />
</td>
</tr>
<tr>
<td class="shade"> </td>
<td>
<asp:Button ID="Btn_SaveOrder" runat="server" SkinID="SaveSkin" Text="Save" ValidationGroup="E" Width="100px" OnClick="Btn_SaveOrder_Click" Height="26px" />
</td>
</tr>
</table>
<table class="tblListing">
<tr>
<td style="text-align: center">
<asp:Image ID="Img_Invoice" runat="server" AlternateText="Invoice" />
</td>
</tr>
</table>
<table class="tblListing">
<tr>
<td colspan="2" class="Heading">Prescription
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center">
<asp:Image ID="Img_Prescription" runat="server" AlternateText="Prescription" />
</td>
</tr>
<tr id="TR_Move" runat="server">
<td runat="server">
<asp:Button Width="100px" ID="Btn_Previouse" runat="server" Text="<< Previouse " CausesValidation="False" SkinID="ShowAllSkin" OnClick="Btn_Previouse_Click" />
</td>
<td runat="server">
<asp:Button ID="Btn_Next" Width="100px" runat="server" Text="Next >>" CausesValidation="False" SkinID="ShowAllSkin" OnClick="Btn_Next_Click" />
</td>
</tr>
</table>
</ContentTemplate>
</ajax:TabPanel>
</ajax:TabContainer>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="Btn_SaveOrder" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="CPH_Footer" runat="Server">
</asp:Content>***

asp.net timer not firing the updatepanel

I have a table within my aspx page content page (using a Master Page also)
The problem is the Timer doesn't seem to be doing the async postback it doesnt even hit the method
I've tried a fresh solution in VS with the below code and it works fine every 10 seconds the event updatepanel is refreshed. So I believe the code is fine but there's something stopping this from working and I can't figure what.
<div class="row" >
<div class="col-md-3">
<asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
<asp:Triggers>
<asp:AsyncPostBackTrigger ControlID="TimerPrayer"></asp:AsyncPostBackTrigger>
</asp:Triggers>
<ContentTemplate>
<table id="tblPrayerTimes" class="table-condensed">
<tr>
<th colspan="3">
<asp:Label ID="LblPrayer" runat="server" CssClass="prayerTimeHeaderscss" Text="Prayer Time"></asp:Label>
</th>
<th colspan="1">
<asp:Label ID="lblJammat" runat="server" CssClass="prayerTimeHeaderscss" Text="Jamaat Time"></asp:Label>
</th>
</tr>
<tr>
<td></td>
<th>
<asp:Label ID="lblToday" runat="server" CssClass="prayerlabeltodaytomorrowcss" Text="Today"></asp:Label>
</th>
<th>
<asp:Label ID="lblTomorrow" runat="server" CssClass="prayerlabeltodaytomorrowcss" Text="Tomorrow"></asp:Label>
</th>
</tr>
<tr>
<td>
<asp:Label ID="lblFajr" runat="server" CssClass="prayerLabelscss" Text="Fajr"></asp:Label>
</td>
<td style="text-align: center">
<asp:Label ID="lblbegFajrTime" runat="server" CssClass="prayerTimescss" Text="00:00"></asp:Label>
</td>
<td style="text-align: center">
<asp:Label ID="lbltmrwFajrTime" runat="server" CssClass="prayerTimeTmrwcss" Text="00:00"></asp:Label>
</td>
<td id="tdfajrJamaatbox" style="text-align: center">
<asp:TextBox ID="txtFajrJamaat" runat="server" Text="00:00" onmousedown="displayPicker('Fajr','tdfajrJamaatbox');" MaxLength="5" CssClass="prayerTimeJamaat"></asp:TextBox>
</tr>
<tr>
<td>
<asp:Label ID="lblSunrise" runat="server" CssClass="prayerLabelscss" Text="Sunrise"></asp:Label>
</td>
<td style="text-align: center">
<asp:Label ID="lblbegSunRiseTime" runat="server" CssClass="prayerTimescss" Text="00:00"></asp:Label>
</td>
<td style="text-align: center">
<asp:Label ID="lbltmrwSunriseTime" runat="server" CssClass="prayerTimeTmrwcss" Text="00:00"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblDkubra" runat="server" CssClass="prayerLabelscss" Text="Dahawa Kubra"></asp:Label>
</td>
<td>
<asp:Label ID="lblDkubraTime" runat="server" CssClass="prayerTimescss" Text="00:00"></asp:Label>
</td>
<td style="text-align: center"></td>
<td id="td1" style="text-align: center"></td>
</tr>
<tr>
<td>
<asp:Label ID="lblDhuhr" runat="server" CssClass="prayerLabelscss" Text="Dhuhr"></asp:Label>
</td>
<td style="text-align: center">
<asp:Label ID="lblbegDhuhrTime" runat="server" CssClass="prayerTimescss" Text="00:00"></asp:Label>
</td>
<td style="text-align: center">
<asp:Label ID="lbltmrwDhuhrTime" runat="server" CssClass="prayerTimeTmrwcss" Text="00:00"></asp:Label>
</td>
<td id="tddhuhrJamaatbox" style="text-align: center">
<asp:TextBox ID="txtDhuhrJamaat" runat="server" CssClass="prayerTimeJamaat" Text="00:00" onmousedown="displayPicker('Dhuhr','tddhuhrJamaatbox');" MaxLength="5"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblAsr" runat="server" CssClass="prayerLabelscss" Text="Asr"></asp:Label>
</td>
<td style="text-align: center">
<asp:Label ID="lblbegAsrTime" runat="server" CssClass="prayerTimescss" Text="00:00"></asp:Label>
</td>
<td style="text-align: center">
<asp:Label ID="lbltmrwAsrTime" runat="server" CssClass="prayerTimeTmrwcss" Text="00:00"></asp:Label>
</td>
<td id="tdasrJamaatbox" style="text-align: center">
<asp:TextBox ID="txtAsrJamaat" runat="server" CssClass="prayerTimeJamaat" Text="00:00" onmousedown="displayPicker('Asr','tdasrJamaatbox');" MaxLength="5"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblMaghrib" runat="server" CssClass="prayerLabelscss" Text="Maghrib"></asp:Label>
</td>
<td style="text-align: center">
<asp:Label ID="lblbegMaghribTime" runat="server" CssClass="prayerTimescss" Text="00:00"></asp:Label>
</td>
<td style="text-align: center">
<asp:Label ID="lbltmrwMaghrib" runat="server" CssClass="prayerTimeTmrwcss" Text="00:00"></asp:Label>
</td>
<td id="tdmaghribJamaatbox" style="text-align: center">
<asp:TextBox ID="txtMaghribJamaat" runat="server" CssClass="prayerTimeJamaat" Text="00:00" onmousedown="displayPicker('Maghrib','tdmaghribJamaatbox');" MaxLength="5"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblIsha" runat="server" CssClass="prayerLabelscss" Text="Isha"></asp:Label>
</td>
<td style="text-align: center">
<asp:Label ID="lblbegIshaTime" runat="server" CssClass="prayerTimescss" Text="00:00"></asp:Label>
</td>
<td style="text-align: center">
<asp:Label ID="lbltmrwIshaTime" runat="server" CssClass="prayerTimeTmrwcss" Text="00:00"></asp:Label>
</td>
<td id="tdishaJamaatbox" style="text-align: center">
<asp:TextBox ID="txtIshaJamaat" runat="server" CssClass="prayerTimeJamaat" Text="00:00" onmousedown="displayPicker('Isha','tdishaJamaatbox');" MaxLength="5"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblJamaat" runat="server" CssClass="prayerLabelscss" Text="Jummah 1"></asp:Label>
</td>
<td></td>
<td></td>
<td id="tdjummah1Jamaatbox" style="text-align: center">
<asp:TextBox ID="txtJummah1Jamaat" runat="server" CssClass="prayerTimeJamaat" Text="13:30" onmousedown="displayPicker('Jummah1','tdjummah1Jamaatbox');" MaxLength="5"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblJummah2" runat="server" CssClass="prayerLabelscss" Text="Jummah 2"></asp:Label>
</td>
<td></td>
<td></td>
<td id="tdjummah2Jamaatbox" style="text-align: center">
<asp:TextBox ID="txtJummah2Jamaat" runat="server" CssClass="prayerTimeJamaat" Text="13:30" onmousedown="displayPicker('Jummah2','tdjummah2Jamaatbox');" MaxLength="5"></asp:TextBox>
</td>
</tr>
<tr>
<td colspan="4">
<asp:Button ID="btnRadioStatus" OnClick="btnRadioStatus_Click" runat="server" Enabled="false" CssClass="cssRadioStatus"
Text="Button" />
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:Timer ID="TimerPrayer" runat="server" OnTick="TimerPrayer_Tick" Interval="10000"></asp:Timer>
</div>
code behind
protected void TimerPrayer_Tick(object sender, EventArgs e)
{
ReadMyData();
}
I had the same problem. I put a timer inside my update panel. It was not firing its OnTick event callback at all.
I moved the timer outside the update panel and then it started firing on the callback.
Then I added a Trigger for the timer in the update panel and it works:
<asp:UpdatePanel ID="UpdatePanelChart" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="tmChartPanel"
EventName="Tick" />
</Triggers>
<!-- ... -->
I had this in my page load which was stopping the postback
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "setDOM", "$(\"#divDigitalClock\").clock({ \"langSet\":\"en\",\"format\":\"24\"});", true);
Maybe you can use trigger.Because update panel postback works with trigger.
You don't have to use timer in update panel,use timer outside the update panel.
And as an example using timer in update panel
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
<ContentTemplate>
<!-- your content here, no timer -->
</ContentTemplate>
</asp:UpdatePanel>
<asp:Timer ID="Timer1" runat="server" Interval="5000" OnTick="Timer1_Tick">
</asp:Timer>
source of code

how to pop up two modalpopup in gridview

I want to pop up two modalpopup from a gridview. I searched online but couldn't find the exact answer. Any help is appreciated.
--------ModalPopupExtender1---------
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
BackgroundCssClass="ModalPopupBG" CancelControlID="btn_Cancel" Drag="true"
PopupControlID="Panel2" PopupDragHandleControlID="Panel2"
TargetControlID="btnNew">
</asp:ModalPopupExtender>
-----------------PopupControlID="Panel2--------------------------
<div id="Panel2" class="popupConfirmation">
<div class="popup_Container">
<div id="PopupHeader" class="popup_Titlebar">
<div class="TitlebarLeft">
<%--
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>
--%>
Edit Customer
</div>
<!--
<div class="TitlebarRight" >
</div>
-->
</div>
<div>
<table bgcolor="#CCFFFF" cellpadding="0" cellspacing="2" width="100%">
<tr>
<td width="5%">
</td>
<td width="25%">
</td>
<td width="65%">
</td>
<td width="5%">
</td>
</tr>
<tr>
<td width="5%">
</td>
<td style="text-align: right" width="25%">
<asp:LabelID="lblName"runat="server"FontSize="11pt" Text="First Name:">
</asp:Label>
</td>
<td style="text-align: left" width="65%">
<asp:TextBox ID="txtFirstName" runat="server" Width="300px">
</asp:TextBox>
<asp:Label ID="lbl_ErrorName" runat="server" ForeColor="Red"
style="display:none" Text="*">
</asp:Label>
</td>
<td width="5%">
</td>
</tr>
<tr>
<td width="5%">
</td>
<td style="text-align: right" width="25%">
<asp:Label ID="lblName2" runat="server" Font-Size="11pt" Text="Second Name:">
</asp:Label>
</td>
<td style="text-align: left" width="65%">
<asp:TextBox ID="txtSecondName" runat="server" Width="300px">
</asp:TextBox>
</td>
<td width="5%">
</td>
</tr>
<%--
<tr>
<td width="5%">
</td>
<td style="text-align: right" width="45%">
<asp:Label ID="lblName0" runat="server" Font-Size="11pt" Text="City">
</asp:Label>
</td>
<td style="text-align: left" width="45%">
<asp:TextBox ID="txtCity" runat="server" Width="200px">
</asp:TextBox>
</td>
<td width="5%">
</td>
<td width="5%">
</td>
</tr>
<tr>
<td width="5%">
</td>
<td style="text-align: right" width="45%">
<asp:Label ID="lblName1" runat="server" Font-Size="11pt" Text="State">
</asp:Label>
</td>
<td style="text-align: left" width="45%">
<asp:TextBox ID="txtState" runat="server" Width="200px">
</asp:TextBox>
</td>
<td width="5%">
</td>
<td width="5%">
</td>
</tr>
--%>
<tr>
<td width="5%">
</td>
<td style="text-align: right" width="25%">
<asp:Label ID="lblAddress1" runat="server" Font-Size="11pt" Text="Address1:">
</asp:Label>
</td>
<td style="text-align: left" width="65%">
<asp:TextBox ID="txtAddress1" runat="server" Width="300px">
</asp:TextBox>
<asp:Label ID="lbl_ErrorAddress1" runat="server" ForeColor="Red"
style="display:none" Text="*">
</asp:Label>
</td>
<td width="5%">
</td>
</tr>
<%--
<tr>
<td width="5%">
</td>
<td style="text-align: right" width="45%">
<asp:Label ID="lblAddress2" runat="server" Font-Size="11pt" Text="Address2:">
</asp:Label>
</td>
<td style="text-align: left" width="45%">
<asp:TextBox ID="txtAddress2" runat="server" Width="200px">
</asp:TextBox>
</td>
<td width="5%">
</td>
<td width="5%">
</td>
</tr>
--%>
<tr>
<td width="5%">
</td>
<td style="text-align: right" width="25%">
<asp:Label ID="lblDOB" runat="server" Font-Size="11pt" Text="Phone">
</asp:Label>
</td>
<td style="text-align: left" width="65%">
<asp:TextBox ID="txtPhone" runat="server" Width="200px">
</asp:TextBox>
<%--
<asp:CalendarExtender ID="txt_DOB_CalendarExtender" runat="server"
TargetControlID="txt_DOB">
</asp:CalendarExtender>
--%>
<asp:Label ID="lblErrorDOB" runat="server" Font-Bold="True" ForeColor="Red"
style="display:none" Text="*">
</asp:Label>
</td>
<td width="5%">
</td>
</tr>
<tr>
<td width="5%">
</td>
<td style="text-align: right" width="25%">
<asp:Label ID="lblDOB0" runat="server" Font-Size="11pt" Text="Mobile">
</asp:Label>
</td>
<td style="text-align: left" width="65%">
<asp:TextBox ID="txtMobile" runat="server" Width="200px">
</asp:TextBox>
</td>
<td width="5%">
</td>
</tr>
<tr>
<td width="5%">
</td>
<td style="text-align: right" width="25%">
</td>
<td style="text-align: left" width="65%">
</td>
<td width="5%">
</td>
</tr>
</table>
</div>
<div align="center">
<asp:Button ID="btn_Update" runat="server"
Text="Save" Width="75px" onclick="btn_Update_Click" />
<asp:Button ID="btn_Cancel" runat="server" Text="Cancel" Width="75px" />
</div>
</div>
</div>
----------------`ModalpopUp`----------------------------
<asp:ModalPopupExtender ID="ModalPopUp" runat="server"
CancelControlID="idclose" Drag="true" DynamicServicePath="" Enabled="True"
PopupControlID="PartyCustomers_idbody"
PopupDragHandleControlID="PartyCustomers_IdTitle"
TargetControlID="btnShowPopup">
<Animations>
<OnShown><Fadein Duration="0.50" /></OnShown>
<OnHiding><Fadeout Duration="0.75" /></OnHiding>
</Animations>
</asp:ModalPopupExtender>
--------------------PartyCustomers_idbody : popupbody--------------
`<div id="PartyCustomers_idbody" runat="server" class="Common_divbody"
>
<div id="PartyCustomers_IdTitle" runat="server" class="Common_divtitle"
>
<div id="idclose" class="Common_close">
</div>
<div class="Common_divhr">
Booked Status</div>
</div>
<div class="ModalPopUpDiv">
<asp:Label ID="lblmessage1" runat="server" Text="Label"></asp:Label>
<asp:GridView ID="dgvSystemDetails" runat="server" AllowPaging="True"
AllowSorting="True" AlternatingRowStyle-CssClass="alt"
AutoGenerateColumns="False" CellSpacing="2" CssClass="mGrid" Font-Bold="True"
Font-Names="Arial" Font-Size="Small" PageSize="12"
Width="750px" DataKeyNames="SystemCode"
onrowdatabound="dgvSystemDetails_RowDataBound">
<AlternatingRowStyle CssClass="alt" />
<Columns>
<asp:BoundField DataField="RegistrationDate" DataFormatString="{0:d}"
HeaderText="Registration Date">
<HeaderStyle />
<ItemStyle />
</asp:BoundField>
<asp:BoundField DataField="SystemCode" HeaderText="System Code" />
<asp:BoundField DataField="Reg_Status" HeaderText="Reg. Status" />
<asp:BoundField DataField="Key" HeaderText="Key" />
<asp:TemplateField>
<ItemTemplate>
<asp:Button ID="btnBlock" runat="server" CssClass="Common_button"
Text="Block" onclick="btnBlock_Click" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</div>`
--------------------------------cs-: RowCommand---code--------------------------
protected void dgvActivatedCustomers_RowCommand1(object sender, GridViewCommandEventArgs e)
{
//Load System details gridview in modalpop up...
if(e.CommandName=="Select")
{
DataSet ds;
int RowIndex = Convert.ToInt32(e.CommandArgument);
long ProductSerialID = Convert.ToInt32(dgvActivatedCustomers.DataKeys[RowIndex].Values["ProductSerialID"]) ;
hdnProuductId.Value= dgvActivatedCustomers.DataKeys[RowIndex].Values["ProductSerialID"].ToString();
lblmessage1.Visible = true;
//string RegStatus = dgvSystemDetails.SelectedRow.Cells[2].Text;
string ProductSerial = dgvActivatedCustomers.Rows[RowIndex].Cells[6].Text;
string Reg_Status = LoadSystemDetails(ProductSerialID).Tables[0].Rows[0]["Reg_Status"].ToString();
lblmessage1.Text = "Activation Code :" + General.GetActivationCode(Convert.ToDouble(ProductSerial)).ToString();
LoadSystemDetails(ProductSerialID);
ds = LoadSystemDetails(ProductSerialID);
//filling data table
DataTable dt = (DataTable)dgvSystemDetails.DataSource;
//Add new columns to datatable
dt.Columns.Add("Key", typeof(System.Int64));
// get key for specific key by passing system code ot getRegistrationKey.
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
string SystemCode = ds.Tables[0].Rows[i]["SystemCode"].ToString();
//lblmessage2.Text = "Key :" + Registration.getRegistrationKey(SystemCode, ProductSerial);
string Key = Registration.getRegistrationKey(SystemCode, ProductSerial);
dt.Rows[i]["Key"] = Key;
}
Session["dgvSystemDetailsDataSource"] = dt;
dgvSystemDetails.DataSource = dt;
dgvSystemDetails.DataBind();
dgvSystemDetails.Visible = true;
if (Reg_Status == "Blocked")
{
lblmessage1.Visible = true;
lblmessage1.Text = "Blocked System";
//dgvSystemDetails.FindControl("btnBlock").Visible = false;
dgvSystemDetails.DataSource = Session["dgvSystemDetailsDataSource"];
dgvSystemDetails.DataBind();
ModalPopUp.Show();
}
ModalPopUp.Show();
}
}
description :btnclick second popup--------------
protected void Button1_Click(object sender, EventArgs e)
{
try
{
Button btn = (Button)sender;
GridViewRow row = (GridViewRow)btn.NamingContainer;
int rowno = row.RowIndex;
txtFirstName.Text = dgvActivatedCustomers.DataKeys[rowno].Values["CustomerName"].ToString();
txtSecondName.Text = dgvActivatedCustomers.DataKeys[rowno].Values["CustomerLName"].ToString();
txtAddress1.Text = (dgvActivatedCustomers.Rows[rowno].Cells[4].Text != " " ? dgvActivatedCustomers.Rows[rowno].Cells[4].Text : "");
txtPhone.Text = (dgvActivatedCustomers.Rows[rowno].Cells[2].Text != " " ? dgvActivatedCustomers.Rows[rowno].Cells[2].Text : "");
txtMobile.Text = (dgvActivatedCustomers.Rows[rowno].Cells[3].Text != " " ? dgvActivatedCustomers.Rows[rowno].Cells[3].Text : "");
hdnId.Value = dgvActivatedCustomers.DataKeys[rowno].Values["CustomerID"].ToString();
txtName.Text = (dgvDemoCust.SelectedRow != "") ? dgvDemoCust.SelectedRow.Cells[0].Text : "";
ModalPopupExtender1.Show();
}
catch (Exception ex) { }
}
Question : The first pop up is showing but the second one doesn't.....any body have any idea

Default Button not working while focus on different control

i have a search form in which i have certain controls (TextBox,DropDownList,CheckBox etc.) i have a search button in which the code for getting the result set if written.I want search button click event to get fired when i hit enter button,for this is have written
<form id="form1" runat="server" defaultbutton="btnSearch">
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
</asp:ScriptManager>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
</telerik:RadCodeBlock>
<telerik:RadDatePicker ID="RadDatePicker1" Style="display: none;" MinDate="01/01/1900"
MaxDate="12/31/2100" runat="server">
<ClientEvents OnDateSelected="dateSelected" />
</telerik:RadDatePicker>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" align="center" valign="middle">
<table width="96%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="400" align="left" valign="top">
<span style="color: #FFFFFF; font-weight: bold;">
<asp:Label ID="lblName" runat="server"></asp:Label></span>
</td>
<td align="right" style="color: #FFFFFF; font-weight: bold;">
<asp:LinkButton ID="lbtnLogout" runat="server" Text="Logout" ForeColor="#FFFFFF"
Font-Bold="true" OnClick="lbtnLogout_Click">Logout</asp:LinkButton>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="10" align="center" valign="middle">
</td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="#FFFFFF">
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="background: url(../img/bg02.png) #FFFFFF no-repeat top right;">
<tr>
<td align="left" valign="middle">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="250" align="left">
<img src="../img/goDigital_Logo01.png" width="198" height="91">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="3" align="center" valign="middle" style="background: url(../img/bg01.png) no-repeat;">
<asp:Label ID="lblError" runat="server" ForeColor="Red"></asp:Label>
<asp:UpdateProgress ID="UpdateProgress2" runat="server">
<ProgressTemplate>
<table cellpadding="0" cellspacing="0" width="140">
<tr>
<td width="26">
<asp:Image ID="Image3" runat="server" ImageAlign="AbsMiddle" Width="16px" Height=" 16px"
CssClass="PreLoader" ImageUrl="~/Images/preloader-square.gif" />
</td>
<td class="HD1b">
Please wait...
</td>
</tr>
</table>
</ProgressTemplate>
</asp:UpdateProgress>
</td>
</tr>
<tr>
<td align="left" valign="top">
<table width="100%" border="0" cellspacing="2" cellpadding="1" style="background: url(../img/bg-shadow.png) repeat-x center bottom;">
<tr>
<td width="20" class="color2">
</td>
<td width="100" class="color2">
<strong>Vendor Code</strong>
</td>
<td width="5">
<strong>:</strong>
</td>
<td colspan="2">
<table cellpadding="0" cellspacing="0" width="80%">
<tr>
<td>
<strong>
<telerik:RadComboBox ID="radtxtVendorCode" runat="server" EmptyMessage="Select Vendor Code"
EnableLoadOnDemand="true" EnableVirtualScrolling="true" Filter="Contains" HighlightTemplatedItems="true"
Height="180px" Style="margin-left: 0px" Width="100%">
<WebServiceSettings Method="GetVendorCode" Path="AccountSearch.aspx" />
</telerik:RadComboBox>
</strong>
</td>
</tr>
</table>
</td>
<td width="130" class="color2">
<strong>Invoice Date</strong>
</td>
<td width="5">
<strong>:</strong>
</td>
<td>
<strong>
<telerik:RadDatePicker ID="RadDPInvoiceDateFrom" runat="server">
<Calendar ID="Calendar3" runat="server" EnableKeyboardNavigation="true">
</Calendar>
</telerik:RadDatePicker>
</strong>
</td>
<td>
<strong>To</strong>
</td>
<td>
<strong>
<telerik:RadDatePicker ID="RadDPInvoiceDateTo" runat="server">
<Calendar ID="Calendar4" runat="server" EnableKeyboardNavigation="true">
</Calendar>
</telerik:RadDatePicker>
</strong>
</td>
</tr>
<tr>
<td class="color2">
<strong>Vendor Name</strong>
</td>
<td>
<strong>:</strong>
</td>
<td colspan="2">
<table cellpadding="0" cellspacing="0" width="80%">
<tr>
<td>
<strong>
<telerik:RadComboBox ID="radtxtVendorName" runat="server" EmptyMessage="Select Vendor Name"
EnableLoadOnDemand="true" EnableVirtualScrolling="true" Filter="Contains" Height="180px"
HighlightTemplatedItems="true" Style="margin-left: 0px" Width="100%">
<WebServiceSettings Method="GetVendorName" Path="AccountSearch.aspx" />
</telerik:RadComboBox>
</strong>
</td>
</tr>
</table>
</td>
<td class="color4">
<strong>Invoice Amount</strong>
</td>
<td>
<strong>:</strong>
</td>
<td>
<strong>
<telerik:RadNumericTextBox ID="RadtxtInvoicFromAmt" runat="server" Culture="en-IN"
EmptyMessage="From Amount" Width="120px">
<EmptyMessageStyle Font-Italic="True" />
</telerik:RadNumericTextBox>
</strong>
</td>
<td>
<strong>To</strong>
</td>
<td>
<strong>
<telerik:RadNumericTextBox ID="RadtxtInvoicToAmt" runat="server" Culture="en-IN"
EmptyMessage="To Amount" Width="120px">
<EmptyMessageStyle Font-Italic="True" />
</telerik:RadNumericTextBox>
</strong>
</td>
</tr>
<tr>
<td class="color1">
<strong>Print Ref. No</strong>
</td>
<td>
<strong>:</strong>
</td>
<td width="160">
<strong>
<telerik:RadTextBox ID="RadtxtPrintRefNo" runat="server" EmptyMessage="Enter Print Ref No"
Width="160px">
<EmptyMessageStyle Font-Italic="True" />
</telerik:RadTextBox>
</strong>
</td>
<td rowspan="3" align="left" valign="top">
<strong>
<img src="../img/digital1.jpg" width="160" height="119"></strong>
</td>
<td class="color4">
<strong>Transaction Date</strong>
</td>
<td>
<strong>:</strong>
</td>
<td>
<strong>
<telerik:RadDatePicker ID="RadDTTxnFromDate" runat="server">
<Calendar ID="Calendar1" runat="server" EnableKeyboardNavigation="true">
</Calendar>
</telerik:RadDatePicker>
</strong>
</td>
<td>
<strong>To</strong>
</td>
<td>
<strong>
<telerik:RadDatePicker ID="RadDTTxnToDate" runat="server">
<Calendar ID="Calendar2" runat="server" EnableKeyboardNavigation="true">
</Calendar>
</telerik:RadDatePicker>
</strong>
</td>
</tr>
<tr>
<td class="color4">
<strong>Invoice No</strong>
</td>
<td>
<strong>:</strong>
</td>
<td>
<strong>
<telerik:RadTextBox ID="RadtxtInvoicNo" runat="server" EmptyMessage="Enter Invoic No"
Width="160px">
<EmptyMessageStyle Font-Italic="True" />
</telerik:RadTextBox>
</strong>
</td>
<td>
</td>
<td class="color4">
<strong>NEFT / Chq No</strong>
</td>
<td>
<strong>:</strong>
</td>
<td>
<strong>
<telerik:RadTextBox ID="RadtxtneftNoFrom" runat="server" EmptyMessage="Enter From Neft No"
Width="120px">
<EmptyMessageStyle Font-Italic="True" />
</telerik:RadTextBox>
</strong>
</td>
</tr>
<tr>
<td valign="top" class="color4">
<strong>Currency</strong>
</td>
<td valign="top">
<strong>:</strong>
</td>
<td valign="top">
<strong>
<telerik:RadComboBox ID="radtxtCurrencyCode" runat="server" Height="121px" HighlightTemplatedItems="true"
Filter="Contains" EmptyMessage="Select Currency" EnableLoadOnDemand="true" EnableVirtualScrolling="true"
Width="163px">
<WebServiceSettings Method="GetCurrencyCode" Path="AccountSearch.aspx" />
</telerik:RadComboBox>
</strong>
</td>
<td valign="top" class="color4">
<strong>Remarks / Naration</strong>
</td>
<td valign="top">
<strong>:</strong>
</td>
<td colspan="4" valign="top">
<strong>
<asp:TextBox ID="txtRemarks" runat="server" Width="330px" TextMode="MultiLine"></asp:TextBox>
</strong>
</td>
</tr>
<tr>
<td align="left" valign="top">
<asp:ImageButton ID="btnSearch" runat="server" ImageUrl="~/img/btnsearch.png" Width="125"
Height="45" OnClick="btnSearch_Click" OnClientClick="return checkdate();" />
</td>
<td colspan="4" valign="top">
<asp:ImageButton ID="btnClear" runat="server" ImageUrl="~/img/btnclear.png" Width="125" Height="45" OnClick="btnClear_Click" />
</tr>
</table>
</td>
</tr>
<tr>
<td height="120" align="left" valign="top" bgcolor="#C2E8F3">
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<telerik:RadGrid ID="rdSearchResult" runat="server" GridLines="None" AllowPaging="True"
SkinID="MySkin" AutoGenerateColumns="false" AllowMultiRowSelection="True" AllowSorting="false"
OnNeedDataSource="rdSearchResult_NeedDataSource" Skin="Windows7">
<PagerStyle AlwaysVisible="True" />
<MasterTableView>
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
<Columns>
<telerik:GridTemplateColumn HeaderText="Supp Code">
<ItemTemplate>
<%# Eval("suppcode")%></ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Party">
<ItemTemplate>
<%# Eval("party_name")%></ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Ref No">
<ItemTemplate>
<%# Eval("print_refno")%></ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Currency">
<ItemTemplate>
<%# Eval("currcode")%></ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Invoice No">
<ItemTemplate>
<%# Eval("invno")%></ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Invoice Amt">
<ItemTemplate>
<%# Eval("invAmt")%></ItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText="Invoice Date">
<ItemTemplate>
<asp:Label ID="lblDate" runat="server" Text='<%#Convert.ToDateTime(Eval("invdt")).ToString("dd/MM/yyyy") %>'></asp:Label>
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
<PagerStyle AlwaysVisible="True"></PagerStyle>
</MasterTableView>
<ClientSettings ClientEvents-OnRowDblClick="rdSearchResultDblClick" EnableRowHoverStyle="true">
<ClientEvents OnRowDblClick="rdSearchResultDblClick"></ClientEvents>
<Selecting AllowRowSelect="true" />
</ClientSettings>
<SelectedItemStyle BackColor="#C2E8F3" />
</telerik:RadGrid>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td bgcolor="#C44533">
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
but this works only when i click somewhere out (take focus off the searching control)and then hit enter
Please suggest
You can place your controls inside a asp:panel and set it's default button.
<asp:Panel ID="p" runat="server" DefaultButton="myButton">
<%-- Text boxes here --%>
<%-- drop down here --%>
.....
<asp:Button ID="myButton" runat="server" />
</asp:Panel>
set a default button to be clicked when the user presses Enter? Simply add the following line to your page's Load event, replacing "btnSearch" with the name of your button. It uses a hidden Page method called RegisterHiddenField and works splendidly:
Page.RegisterHiddenField("__EVENTTARGET", "btnSearch")
Source :-Default Button
try using Button and its UseSubmitBehavior
<asp:Button ID="btnSearch" runat="server" Width="125" Height="45" UseSubmitBehavior="true" />
instead of Image button.
You can easily set the background image of button using css. so don't use Image Button
Place this script below the scriptmanager:
<script type="text/javascript">
var $p = Telerik.Web.UI.RadComboBox.prototype;
var keyDownHandler = $p._onKeyDown;
$p._onKeyDown = function (e) {
var oReturnValue = e.returnValue;
var oPreventDefault = e.preventDefault;
var keyCode = e.keyCode || e.which;
if (keyCode === 13)
e.preventDefault = null;
keyDownHandler.call(this, e);
if (keyCode === 13) {
e.returnValue = oReturnValue;
e.preventDefault = oPreventDefault;
}
};
</script>

Why can I not obtain the value of a textbox in a FormView?

So, I was having some issues obtaining the value of of an ASP TextBox Server Control while it was in a FormView. Here is the code.
<EditItemTemplate>
<table>
<tr>
<td>
<div style="margin-bottom: 10px; font-family:Calibri;">
Project Number
</div>
</td>
<td colspan="2">
<asp:TextBox ID="projectidbox" runat="server" Width="90%" Style="margin-bottom: 10px;"
Text='<%# Bind("ProjectID") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td style=" font-family:Calibri;">
Project Name
</td>
<td>
<asp:TextBox ID="NameBox" runat="server" Width="90%" Text='<%# Bind("Name") %>'> </asp:TextBox>
</td>
<td style=" font-family:Calibri;">
Project Start
</td>
<td>
<asp:TextBox ID="dateStartedBox" runat="server" Width="90%" Text='<%# Bind("DateStarted")%>'></asp:TextBox>
</td>
<td style=" font-family:Calibri;">
Project End
</td>
<td>
<asp:TextBox ID="dateFinishedBox" runat="server" Width="102%" Text='<%# Bind("DateFinished")%>'></asp:TextBox>
</td>
</tr>
<tr>
<td style=" font-family:Calibri;">
Total Cost ($)
</td>
<td>
<asp:TextBox ID="TotalCostBox" runat="server" Width="90%" Text='<%# Bind("TotalCost")%>'></asp:TextBox>
</td>
<td style=" font-family:Calibri;">
Assess. Start
</td>
<td>
<asp:TextBox ID="assessmentStartBox" runat="server" Width="70%" Text='<%# Bind("BeginTerm")%>'></asp:TextBox>
</td>
<td style=" font-family:Calibri;">
Assess. End
</td>
<td>
<asp:TextBox ID="assessmentEndBox" runat="server" Width="90%" Text='<%# Bind("EndTerm")%>'></asp:TextBox>
</td>
</tr>
<tr>
<td style=" font-family:Calibri;">
Assessable Area
</td>
<td>
<asp:TextBox ID="AssessableFrontageBox" runat="server" Width="90%" Text='<%# Bind("AssessableFrontage")%>'></asp:TextBox>
</td>
<td style=" font-family:Calibri;">
Ordinance
</td>
<td>
<asp:TextBox ID="ordinancebox" runat="server" Width="70%" Text='<%# Bind("Ordinance")%>'></asp:TextBox>
</td>
<td style=" font-family:Calibri;">
Calc Field
</td>
<td>
<asp:TextBox ID="calcfieldbox" runat="server" Width="90%" Text='<%# Bind("CalcField")%>'></asp:TextBox>
</td>
</tr>
<tr>
<td style=" font-family:Calibri;">
Total Intersections
</td>
<td>
<asp:TextBox ID="intersectionsbox" runat="server" Width="90%" Text='<%# Bind("TotalIntersections") %>'></asp:TextBox>
</td>
<td style=" font-family:Calibri;">
County ID
</td>
<td>
<asp:TextBox ID="countyidbox" runat="server" Width="70%" Text='<%# Bind("CountyID") %>'></asp:TextBox>
</td>
<td style=" font-family:Calibri;">
Adjustment
</td>
<td>
<asp:TextBox ID="adjustmentbox" runat="server" Width="90%" Text='<%# Bind("Adjustment") %>'></asp:TextBox>
</td>
</tr>
<tr>
<td style=" font-family:Calibri;">
Sum Assessments
</td>
<td>
<asp:TextBox ID="sumassessbox" runat="server" Width="90%" Text='<%# Eval("SumAssessments")%>'></asp:TextBox>
</td>
<td style=" font-family:Calibri;">
Status
</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server" Width="75%" Height="22px" DataValueField="Status">
<asp:ListItem></asp:ListItem>
<asp:ListItem>Pre-Planning</asp:ListItem>
<asp:ListItem>Active</asp:ListItem>
<asp:ListItem>Complete</asp:ListItem>
<asp:ListItem>Cancelled</asp:ListItem>
</asp:DropDownList>
</td>
<td colspan="2">
<asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal">
<asp:ListItem>Ln Ft</asp:ListItem>
<asp:ListItem>Acre</asp:ListItem>
<asp:ListItem>Flat</asp:ListItem>
</asp:RadioButtonList>
</td>
</tr>
<tr>
<td style="font-family:Calibri;"> Comments </td>
</tr>
<tr>
<td colspan="6">
<asp:TextBox ID="TextBox9" runat="server" TextMode="MultiLine" Width="90%" Text='<%# Bind("Comment") %>'></asp:TextBox>
</td>
</tr>
</table>
</EditItemTemplate>
You can use the FindControl function to seach for the text box.
var textbox = (TextBox)GridView.FindControl("txtName);
if (textbox != null)
{
//working goes here.
}

Categories

Resources