progress bar issue - c#

I have to set a progress bar on my webpage which on selection of any drive information from dropdownlist shows the used space and available space. how can i do this. could any1 send me the code
This is my aspx code.
<fieldset style="width:1000px">
<legend> Drive Info </legend>
<table style="width:100%;">
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text="Select Drive" ></asp:Label>
</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server" onselectedindexchanged="DropDownList1_SelectedIndexChanged"
AutoPostBack="True" Height="24px" ondatabinding="Page_Load" ondatabound="Page_Load"
Width="189px" ViewStateMode="Enabled" AppendDataBoundItems="True">
<asp:ListItem Selected="True">--Select--</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text="Disk Name"></asp:Label>
</td>
<td>
<asp:Label ID="Label8" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label3" runat="server" Text="Used Space"></asp:Label>
</td>
<td>
<asp:Label ID="Label9" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label4" runat="server" Text="Free Space"></asp:Label>
</td>
<td>
<asp:Label ID="Label10" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label5" runat="server" Text="Volume Name"></asp:Label>
</td>
<td>
<asp:Label ID="Label11" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label6" runat="server" Text="System Name"></asp:Label>
</td>
<td>
<asp:Label ID="Label12" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label7" runat="server" Text="TotalSize"></asp:Label>
</td>
<td>
<asp:Label ID="Label13" runat="server" Text="Label"></asp:Label>
</td>
</tr>
</table>
<%--<table border='0' cellspacing='0' cellpadding='0' height='10px' style="background-color:#B5CCFF" >
<tr>
<td height='20px' width='5' style="background-color:Blue"></td>
<td width='5' style="background-color:Blue"></td>
<td width='5' style="background-color:Blue"></td>
<td width='5' style="background-color:Blue"></td>
<td width='5' style="background-color:Blue"></td>
<td width='5' style="background-color:Blue"></td>
<td width='5' style="background-color:Blue"></td>
<td width='5' style="background-color:Blue"></td>
<td width='5' style="background-color:Blue"></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
</tr>
</table>--%>

Here you have tutorial: How to make progress bar in ASP.NET

Here is the answer to the similar question
Progress Bar
Well Nikita, you have to add the dropdown in the updatepanel.
<asp:updatepanel id="uppanel1" runat="server">
<asp:....................>
</asp:updatepanel>
<asp:updateprogress>
///////////// add the progress bar here.....
</asp:updateprogress>

<fieldset style="width:1000px">
<legend> Drive Info </legend>
<table style="width:100%;">
<tr>
<td>
<asp:Label ID="Label1" runat="server" Text="Select Drive" ></asp:Label>
</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server" onselectedindexchanged="DropDownList1_SelectedIndexChanged"
AutoPostBack="True" Height="24px" ondatabinding="Page_Load" ondatabound="Page_Load"
Width="189px" ViewStateMode="Enabled" AppendDataBoundItems="True">
<asp:ListItem Selected="True">--Select--</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label2" runat="server" Text="Disk Name"></asp:Label>
</td>
<td>
<asp:Label ID="Label8" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label3" runat="server" Text="Used Space"></asp:Label>
</td>
<td>
<asp:Label ID="Label9" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label4" runat="server" Text="Free Space"></asp:Label>
</td>
<td>
<asp:Label ID="Label10" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label5" runat="server" Text="Volume Name"></asp:Label>
</td>
<td>
<asp:Label ID="Label11" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label6" runat="server" Text="System Name"></asp:Label>
</td>
<td>
<asp:Label ID="Label12" runat="server" Text="Label"></asp:Label>
</td>
</tr>
<tr>
<td>
<asp:Label ID="Label7" runat="server" Text="TotalSize"></asp:Label>
</td>
<td>
<asp:Label ID="Label13" runat="server" Text="Label"></asp:Label>
</td>
</tr>
</table>
<%--<table border='0' cellspacing='0' cellpadding='0' height='10px' style="background-color:#B5CCFF" >
<tr>
<td height='20px' width='5' style="background-color:Blue"></td>
<td width='5' style="background-color:Blue"></td>
<td width='5' style="background-color:Blue"></td>
<td width='5' style="background-color:Blue"></td>
<td width='5' style="background-color:Blue"></td>
<td width='5' style="background-color:Blue"></td>
<td width='5' style="background-color:Blue"></td>
<td width='5' style="background-color:Blue"></td>
<td width='5' style="background-color:Blue"></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
<td width='5'></td>
</tr>
</table>--%>

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

Remove spacing of label in specified design sample

I have following design:
Code for it:
<table width="70%" align="center" class ="TableBorder">
<tr>
<td colspan="2" class="Heading" align="center">
Add Client
</td>
</tr>
<tr>
<td class="NormalText" align="right">
Client Name:
</td>
<td align="left">
<asp:TextBox ID="txtClientName" runat="server" CssClass="ThinTextBox"></asp:TextBox>
<asp:Label ID="lblAgentName0" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
</td>
</tr>
<tr>
<td class="NormalText" width="40%" align="right">
Client Login Email ID:
</td>
<td align="left">
<asp:TextBox ID="txtClientID" runat="server" CssClass="ThinTextBox"></asp:TextBox>
<asp:Label ID="lblAgentName1" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
</td>
</tr>
<tr>
<td class="NormalText" align="right">
Client Password:
</td>
<td align="left">
<asp:TextBox ID="txtClientPwd" runat="server" CssClass="ThinTextBox"></asp:TextBox>
<asp:Label ID="lblAgentName2" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
</td>
</tr>
<tr>
<td align="right" class="NormalText">
Contact No.:</td>
<td align="left">
<asp:TextBox ID="txtContactNo" runat="server" CssClass="ThinTextBox"></asp:TextBox>
<asp:Label ID="lblAgentName3" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
</td>
</tr>
<tr>
<td align="right" class="NormalText" valign="top" >
Address:</td>
<td align="left">
<asp:TextBox ID="txtAddress" runat="server" CssClass="ThinTextBox"
Height="100px" TextMode="MultiLine" Width="200px"></asp:TextBox>
<asp:Label ID="lblAgentName4" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
</td>
</tr>
<tr>
<td align="right" class="NormalText" width="30%">
</td>
<td align="left">
<asp:Button ID="btnSave" runat="server" CssClass="ButtonColor" Text="Save" />
<asp:Button ID="btnCancel" runat="server" CssClass="ButtonColor"
Text="Cancel" />
</td>
</tr>
</table>
I just wanted to remove spacing between marked area of Address textbox and "*" label.
I tried to give property as valign="top" to label, but its not accepting it.
Please help me.
try this
add style="vertical-align:top;" to label
<asp:Label ID="lblAgentName4" runat="server" ForeColor="#FF3300" Text="*" style="vertical-align:top;"></asp:Label>
Try this one,
<table width="70%" align="center" class="TableBorder">
<tr>
<td colspan="3" class="Heading" align="center">
Add Client
</td>
</tr>
<tr>
<td class="NormalText" align="right">
Client Name:
</td>
<td align="left" colspan="2">
<asp:TextBox ID="txtClientName" runat="server" CssClass="ThinTextBox"></asp:TextBox>
<asp:Label ID="lblAgentName0" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
</td>
</tr>
<tr>
<td class="NormalText" width="40%" align="right">
Client Login Email ID:
</td>
<td align="left" colspan="2">
<asp:TextBox ID="txtClientID" runat="server" CssClass="ThinTextBox"></asp:TextBox>
<asp:Label ID="lblAgentName1" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
</td>
</tr>
<tr>
<td class="NormalText" align="right">
Client Password:
</td>
<td align="left" colspan="2">
<asp:TextBox ID="txtClientPwd" runat="server" CssClass="ThinTextBox"></asp:TextBox>
<asp:Label ID="lblAgentName2" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
</td>
</tr>
<tr>
<td align="right" class="NormalText">
Contact No.:
</td>
<td align="left" colspan="2">
<asp:TextBox ID="txtContactNo" runat="server" CssClass="ThinTextBox"></asp:TextBox>
<asp:Label ID="lblAgentName3" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
</td>
</tr>
<tr>
<td align="right" class="NormalText" valign="top">
Address:
</td>
<td align="left" class="style1" valign="top">
<asp:TextBox ID="txtAddress" runat="server" CssClass="ThinTextBox" Height="100px"
TextMode="MultiLine" Width="200px"></asp:TextBox>
</td>
<td align="left" valign="top">
<asp:Label ID="lblAgentName4" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
</td>
</tr>
<tr>
<td align="right" class="NormalText" width="30%">
</td>
<td align="left" colspan="2">
<asp:Button ID="btnSave" runat="server" CssClass="ButtonColor" Text="Save" />
<asp:Button ID="btnCancel" runat="server" CssClass="ButtonColor" Text="Cancel" />
</td>
</tr>
</table>
you must use text vertical-align: text-top; in your css for td like this:
<td align="left" style="vertical-align: text-top;">
<asp:TextBox ID="txtAddress" runat="server" CssClass="ThinTextBox"
Height="100px" TextMode="MultiLine" Width="200px"></asp:TextBox>
<asp:Label ID="lblAgentName4" runat="server" ForeColor="#FF3300" Text="*"></asp:Label>
</td>
Because your asp renders your Label control to html span element, and for spans need text-top style/

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.
}

How to get dropdownlist value within a repeater, to be inserted in a method?

I've got this repeater on My .aspx page :
<asp:Repeater ID="RptCart" runat="server" OnItemDataBound="RptCart_ItemDataBound"
OnItemCommand="RptCart_ItemCommand">
<HeaderTemplate>
<table class="style1" style="border-style: solid; border-width: 1px">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td colspan="2">
</td>
<td valign="top">
NUMBER OF SHIRTS
</td>
<td>
</td>
<td valign="top">
EXTRAS
</td>
<td>
</td>
<td valign="top">
DISCOUNTS
</td>
<td>
</td>
<td valign="top">
SUBTOTAL
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<%# Container.ItemIndex + 1 %>
</td>
<td style="text-align: center">
<asp:Image ID="imgFabric" runat="server" Width="55px" Height="55px" />
</td>
<td>
<br />
Quantity<br />
<asp:DropDownList ID="ddlQuantity" runat="server" AutoPostBack="true">
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="3">3</asp:ListItem>
<asp:ListItem Value="4">4</asp:ListItem>
<asp:ListItem Value="5">5</asp:ListItem>
<asp:ListItem Value="6">6</asp:ListItem>
<asp:ListItem Value="7">7</asp:ListItem>
<asp:ListItem Value="8">8</asp:ListItem>
<asp:ListItem Value="9">9</asp:ListItem>
<asp:ListItem Value="10">10</asp:ListItem>
</asp:DropDownList>
<br />
</td>
<td>
</td>
<td valign="top">
Supplement for monogram
</td>
<td valign="top">
0,00
</td>
<td valign="top">
Discount for short sleeves
</td>
<td valign="top">
0,00
</td>
<td valign="top">
Basic price<br />
Extras<br />
Discounts
</td>
<td>
</td>
<td valign="top">
0,00<br />
0,00<br />
0,00
</td>
</tr>
<tr>
<td>
</td>
<td style="text-align: center">
</td>
<td>
<asp:LinkButton ID="lnkCancel" runat="server" Text="Cancel" CommandName="Cancel"></asp:LinkButton>
</td>
<td>
</td>
<td>
<b>Total of extras</b>
</td>
<td>
<b>0,00</b>
</td>
<td>
<b>Total discount </b>
</td>
<td>
<b>0,00</b>
</td>
<td>
<b>Total per shirt </b>
</td>
<td>
</td>
<td>
<b>0,00</b>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table></FooterTemplate>
</asp:Repeater>
The question is, how can i get the Dropdownlist value from the repeater ? And the dropdownlist value is executed within a method(let's say : "private void InsertDatabase()")
This code purpose is to insert the Dropdownlist value to the database, and it's fired when the Button is clicked (I put the ""private void InsertDatabase()" on the "Click" event of the button.
Thanks in advance.
You can get drop down list value by using below mentioned code
foreach (RepeaterItem rptItem in RepeaterName.Rows)
{
DropDownList ddlQuantity = (DropDownList)gvr.FindControl("ddlQuantity");
}
Through this way you can find drop down list and can get it's value.

Categories

Resources