.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Validate time (MaskedEdit) if checkbox is checked

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :ASP.Net
Hi,I'm using AjaxToolkit and it works just fine. In one form i'm using the Time field (MaskedEdit). I need to validate Time field only if a tickbox is ticked. Is it possible?Thanks in advance,Vladimir

View Complete Post

More Related Resource Links

How to set the checkbox state "checked or not checked" from a database


hey In the code I have here, I need to set the checkbox state from a database but I dont know the properties:

while (l_objRead.Read())
                         //txtUserName.Text = l_objRead["UserName"].ToString().Trim();
                         txtWerknemerNaam.Text = l_objRead["Naam"].ToString().Trim();
problem here => cbAktief.CheckState = l_objRead["Aktief"];

don't know how to set the state, help pleaz :)

validate the selection of atleast one checkbox in the gridview using javascript


 i have a gridview with a checkbox in the templatefield as given  below,

<asp:GridView runat="server" ID="gvAsgnHw"  AutoGenerateColumns="False"   >
        <asp:CheckBox id="cbAsgnHwGrid"   runat="server" /> </ItemTemplate></asp:TemplateField>

         <asp:BoundField DataField="Resource_id" HeaderText="Resource ID"/>
        <asp:BoundField DataField="Resource_name" HeaderText="Hardware Name" />

I want to check the selection of atleast one checkbox on a button click using javascript.
pls help

Checkbox Checked


I am currently trying to write some code that allows an admin to add users to a system by selecting a checkbox and then clicking a button at the top of the screen that will allow for a mass user add.  I am new to ASP and am trying to figure out how to make the system recognize each checkbox that is checked only to add to the database.  Any ideas on where to start on this?  Thanks

Html.CheckBoxFor - how can I make checkbox default checked ?

I have:Html.CheckBoxFor(model => model.available) how can I have checkbox default checked ?

validate date/time span and alow only time input

Hi, I have 2 small questions: 1. How can I  make a filed for input only time without date? 2. I need to make a date/time validation in form like: if(time between begin_date_field  and end_date_field) is not in intersection (time between begin_date_field  and end_date_field) of any item in list) Can I make this validation only using VisualStudio2010 or is there a simpler way? ( I need this for small list for managing reservations of conference rooms )

Checkbox checked changed event inside gridview

Hi All, In my gridview there are 8 checkboxex in each row : 'Sunday' to 'Saturday' and one for 'All'. If 'All' is checked in a particular row, all other checkboxes in that row should be checked instantly, and viserversa. Can i do this in checkbox checked_changed event, if so how do i access the current row of the gridview in the checked changed event? Thanks in advance

Enable/Disable controls in a td when checkbox is checked

hi,I have a table with 10 rows.Each row having 3 asp controls (checkbox,textbox and dropdownlist).on pageload all controls except checkboxes should be disabled and If we check any checkbox the controls(textbox and dropdownlist) in that row are should be enable.pls reply me.Thanks in Advance.

Using CheckBox in DataList to set checked property

  I have a field called receive e-mail, field char (1) = "Y" (Yes) out "N" (No). I am using the DataList Control CheckBox inside when you enter Edit mode code EditTemplate am placing the following code:<Asp: DataList ID = "DataList1" runat = "server ".... " ye="" closure_uid_uriylf="527"><EditItemTemplate><Asp: CheckBox ... '/> " ye="Checked='' />" closure_uid_uriylf="529">Checked ='<%# Eval ("CHR_OPTIN_SMS ")==" S"? True: false%> '/> " ye="" closure_uid_uriylf="530" mce_style="BACKGROUND-COLOR: #fff"></ EditItemTemplate>.... " ye="" closure_uid_uriylf="532" mce_style="BACKGROUND-COLOR: #fff"></ Asp: DataList>When I run the program with any records he did not show marked and should be checked when the database is "S" in the field CHR_OPTIN_SMS.Could someone help me? if the above code is correct, if not, what should I do to solve this problem.

Getting checked value of a checkbox created at runtime c#

Getting checked value of a checkbox created at runtime c# I use visual studio 2008, and vc# in my program i create a series of controls, inlcuding checkboxs inside an arraylist, with i=0 and increment with each control: this.arylTxtGEItems.Add(new System.Windows.Forms.CheckBox()); ((System.Windows.Forms.CheckBox)this.arylTxtGEItems[i]).Location = new System.Drawing.Point( groupBoxParametros.Location.X + 20 + (c * (w + 20)), groupBoxParametros.Location.Y + 45 + (r * (h + 16))); ((System.Windows.Forms.CheckBox)this.arylTxtGEItems[i]).Name = "CheckBox_" + i.ToString(); ((System.Windows.Forms.CheckBox)this.arylTxtGEItems[i]).Size = new System.Drawing.Size(128, 21); ((System.Windows.Forms.CheckBox)this.arylTxtGEItems[i]).TabIndex = j + 2; ((System.Windows.Forms.CheckBox)this.arylTxtGEItems[i]).Text = "&All"; ((System.Windows.Forms.CheckBox)this.arylTxtGEItems[i]).Checked = true; this.Controls.Add(((System.Windows.Forms.CheckBox)this.arylTxtGEItems[i++])); It works good, i can see my controls and use them :) The problem is that i dont know how to access a control that i created this way, for example the name of the first checkbox, is "CheckBox_0" how do i get the value of "CheckBox_0".Checked? Thank you for your help saludos rubenc  

How to use jQuery to set checkbox is checked


How do I use the jQuery set
If checkbox's value in the string (cbx1, cbx2, cbx5, cbx7),
set the checkbox is checked.
Thank you

How do I use the jQuery set

If checkbox's value in the string (cbx1, cbx2, cbx5, cbx7),

set the checkbox is checked.

Thank you

Checkbox not checked with spacebar



    In my application i am using DataGrid and as datagrid items i am using checkbox. For it i am using template as,

 <my:DataGrid Margin="10,10,10,10"
                     AutoGenerateColumns="False" RowHeaderWidth="0" 
                     FontSize="12" IsTabStop="False"                      
                     SelectionMode="Single" CanUserAddRows="False"            
                     ItemsSource="{Binding}" GridLinesVisibility="None"                   
                     Width="390" VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.VirtualizationMode="Standard"
                     HeadersVisibility="None" >

              <CheckBox Margin="2,0,0,0" Content="{Binding}" Width="380">

Checkbox does not remained checked



I'm having a problem with my check box on my ASP form.  When clicking on it it will execute the code attached to it (in C#) without any problems.  The issue arises when the page posts back.  When it posts back, the check box does not save its state and becomes unchecked.

Can anyone shed some light on this for me?

Thanks in advance

jquery - assign a text to a textbox when checkbox is checked by client


hi guys.

I have a checkbox on my project and I have textboxes as well. I tried some jquery code as you can see below for this function;

I would like to get the ctl00$MainContent$firstnametxt.text value to ctl00$MainContent$firstnamedrivertxt.text value when the checkbox is clicked and I want the ctl00$MainContent$firstnamedrivertxt.text to be null if the checkbox is unchecked. how can I do that? the below one doesn't work for me.

<script type="text/javascript">
    //var myspan = $('#MyCheckBoxHere');

    $('#ctl00_MainContent_CheckBox1').click(function () {

        if ($(this).is(':checked')) {
        else {

How to render a checked CheckBox to a RenderTargetBitmap ?


My checkbox is rendered without a check mark.  If I use only one checkbox (instance object) to render then I can get the check mark to show, but I cannot use this solution.  I need be able to render it using the local checkbox.  This checkbox has the Aero theme applied to it by default and this is also a must have for me.  Other themes built-in themes like Royal, and Luna render with a check mark.


<Canvas Name="canvas">
  <Button Click="Button_Click" Canvas.Left="440" Canvas.Top="

Set Checkbox.checked on modalpopup

I'm having trouble setting the checkbox.checked on a modalpopup. setting textbox.text is no problem.
Hop somebody can help me.
 <asp:Panel ID="pnlAddChild" runat="server" CssClass="Back_ModalPopup" style="display:none" Width="250" Height="350">
            <h1 class="Back_bodycontent">Add Child</h1>       
            <asp:Label ID="lblAddLabelNL" Text="Label:" runat="server" Width="50px"/>
            <asp:Textbox ID="tbAddLabelNL" runat="server" />            
            <br />
            <asp:Label ID="lblAddLinkNL" Text="Link:" runat="server" Width="50px"/>
            <asp:Textbox ID="tbAddLinkNL" runat="server" Text="http://" />
          <br />
            <asp:Label ID="lblActive" Text="Actief:" runat="server" Width="50px"/>
            <asp:PlaceHolder ID="phCHNL" runat="server" />            

Custom checkbox control 'checked' property is not working .


Hello ,


Iam developing a custom checkbox control deriving from the 'compositecontrol' which i need to use it for a composite control purpose.



public class TngCheckBox : CompositeControl


i have written the required properties which are working fine except the "checked" property. he

How to remember the selection checked/unchecked ToolStripMenuItem next time when user opens the appl


I have a menu item "Run at Windows Startup" on a form. It is checked by default. When its state is checked I create a shortcut file so it can start automatically when windows starts. And if its unchecked I delete the shortcut file so that it wont start. This function is written on the application's exit button.

But then, if user start the application manually from the start menu, as the "Run at Windows Startup" item is checked by default user has to uncheck it everytime s/he exits from the application.

So my questions, is there any easy way to remember this selection so user don't have to uncheck it each time s/he exits.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend