.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

Saving Check boxes

Posted By:      Posted Date: August 26, 2010    Points: 0   Category :SharePoint

I am creating an application that uses several check boxes. I check one or more of these check boxes. When I save a record and reopen it all field come back with the appropriate info, except the check boxes come back unchecked. I am using a date type "bit". It apperas that I have the check boxes bound to the right fields in the table. Does anyone have any suggestions<

Keith @ LPG

View Complete Post

More Related Resource Links

Javascript code for Selection of all check boxes


        <asp:Repeater ID="rptroot" runat="server"  onitemdatabound="rptroot_ItemDataBound">
        <table style="background-color:GrayText">
        <td align="char" charoff="45%" char="." > 
        <asp:CheckBox ID="Chkroot" runat="server" Text='<%DataBinder.Eval(Container.DataItem, "ApplicationDesc")%>' />
               <b><%# DataBinder.Eval(Container.DataItem, "ApplicationDesc")%></b><br />
          <tr valign=middle ><td colspan="6">          
      <asp:Repeater ID="rptsub" runat="server">
           <td rowspan="7" >
           <asp:CheckBox ID="Chksub" runat="server" GroupName='<%DataBinder.Eval(Container.DataItem, "PermissionName")%>'/>
         <i> <%# DataBinder.Eval(Container.DataItem, "PermissionName")%></i><br />

How to consolidate what was actually selected with check boxes?


I have an infopath form that has 100 checkboxes returning whole numbers if checked on the form. Standard section, not in a repeating table. How can I create a summary of which boxes were checked, and the content related to the checked boxes?

I have a secondary list in sharepoint that is associated with the check boxes. Checkbox 10 =whole number 10, that references secondary ID 10. This allows me to change the secondary list, and not mess with the form.

Seems like I have tried everything to get this detail to a summary page view. I found limitations to text boxes limited to 255 characters. No luck with importing to list boxes. String statements have not produced the desired result.(probably my syntax. 

Ideally I would love to have a repeating table that grows with each checkbox and contains the secondary data, or removes the smae if unchecked. What i can gather is the repeating tables are not very robust.

Hers the kicker I would like to work within the restraints of the tools and not use code that requires admin approval each time the form updates. If i could do this within infopath or generate a summary in workflow, that would work.

I how turn to the experts.

A little help here...

check or uncheck boxes in datagrid using Javascript


Here is the situation: I have a checkbox in the header of the datagrid and I want to use Javascipt so when I check the box, all of the checkboxes in the datagrid are checked (or unchecked if the one on top is unchecked).  How do I reference the asp:checkboxes in the datagrid?

<script type="text/javascript" language="javascript" id="clientEventHandlersJS">
    function SelectAll(isChecked) {
        var chkb = document.getElementsByTagName('asp:checkbox')
        for (var i = 1; i < chkb.length; i++) {
            chkb[i].checked = isChecked;

<asp:DataGrid id="DataGrid2" runat="server">
        <asp:TemplateColumn SortExpression="InMailing" HeaderText="In Mailing">
            <HeaderTemplate >

Conditional Formatting - Verify a number of check boxes have been checked before showing a button?


I would like to Hide a Submit button until all the check boxes are equal to true? How would I go about verifying all boxes equal true?

Group check boxes

Hi group,
How can I group a couple of check boxes on my form so that only ONE can be checked an anytime?
I've tried placing them onto a panel but I can still check them both.
Using VB.NET

Report manager multiselect check boxes reset when report is run


I have a report with a multi-select checkbox list in report manager.  When I choose 4-5 items and click the 'View Report' button (this is MSRS 2005) the page flashes and all the checkboxes are blanked out and no report loads.

If I just do this over an over it sometimes works.

On a bad day I try this 9 unsuccessful times for every one successful time.  The choices selected are always the same.

This is annoying and frustrating.




Using a CompareValidator to check input is a valid date

The CompareValidator can do more than just compare two controls. You can also compare it against several of the main .net data types such as Date, Integer, Double and Currency.

To do this you would set Operator="DataTypeCheck" and instead of setting the ControlToCompare or ValueToCompare attributes as you normally would you use the Type="Date" (or any of the data types I have listed above).

Binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Here is the code for binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Check All with JQuery and a Asp.Net GridView

Display a Grid on the screen with a checkbox in each row. At the bottom of the page have "Check All" button.

Typically if I need to do anything interesting I use a template column. So my GridView will look like the one below (most other columns removed for readability). The only interesting point to note is the CssClass="ApprovalCheckBox" in the CheckBox ItemTemplate.

The Free Barcode Creator produces barcode images one at a time, and allows easy saving to a file or

The Free Barcode Creator produces barcode images one at a time, and allows easy saving to a file or pasting into an application. 2D versions are also available:

check box control


Hi ,

I have a three check box in my web form ,i need to choose only one check box, if i choose one check box

another 2 check box automatically unchecked

can i use jquery for check box

I thought this would be simple... Trying to create a login does an ajax check before submit


I have the standard .net login control that is working.  (Still learning .net after 15yrs of classic)

What I want to do is OnButtonClick run a javascript function (to do an ajax call to the db to check if login is valid or not) and if it returns true, then submit the form normally, else don't submit. The piece that I can't figure out, is how to correctly override the default click even to hit my JS routine and then submit the form properly afterwards.

Thanks ahead of time

Does this look correct for saving a file/ new record to a database


So thank you for all your help so far, So I think i got this right,
but would like for you all to look it over to see if there is any
areas I might run into trouble with:

//using asp.net mvc 2
the table (sql server 2005, using entities framework)
table fields
"Pattern_Media_GUID  uniqueid 
"Pattern_GUID  uniqueid
"Media varbinary(max)  
"height int
"Width int
"Media_Type String (50)

the form:
<h2> Add Media to this pattern</h2>
<% Html.EnableClientValidation(); %>
<% Html.BeginForm("AddMedia", "Pattern", new { id= Model.Pattern_Guid} , FormMethod.Post, new {enctype = "multipart/form-data"}); %>
    <%: Html.Label("height") %>
    <%: Html.TextBox("height") %>

    <%: Html.Label("width") %>
    <%: Html.TextBox("width") %>

    <%: Html.Label("Media") %>
    <input type="file" id="Media" name="Media" />
    <input type="submit" name=

how to check a textbox value in jquery?



I want to perform some action when an asp.net textbox value length is greater than 1 character. And for this I wanted to know how to write this check in jquery?

I have created a check like below-

if ($('[id=txtUserInput]').val().length > 2)
{ do some work...} 

But its giving me the following error

$("[id=txtUserInput]").val() is undefined

Can anybody let me know the right way of doing this?



How to check for null/empty strings on dynamic objects?


What is the proper way to check for null or empty strings on dynamic objects? This is the only solution I've found so far:

if (admin.PasswordHash.GetType() == typeof(DBNull) || admin.PasswordHash == string.Empty)

If the field is null, the object returned is DBNull.Value, but if the field is empty string, it's return as a System.String object. This makes it impossible to do regular "admin.PasswordHash == DBNull.Value" check, as that will fail whenever the field has been set to empty string. Is my example the right (and only) way to go?

Automatically redirect to HTTPS and check if SSL is active



I've set in the web.config:

    <!-- User Authentication -->
    <authentication mode="Forms">
      <forms loginUrl="~/Page/View/Content/Login.aspx" timeout="2880" requireSSL="true" />

This works fine. If there is no ssl connection, the login form doesn't continue. But I would like to check if ssl is active (in codebehind) and, if it's possible, to automatically the user to the https page if he's currently on http. (I could do this job by manually redirect with page.response("https://url.../login.aspx"); but this is not really generic. For example if the webapp is moved to another domain it doesn't work anymore... I'm looking for something like: FormsAuthentication.RedirectWithSSL(); or so... :D)


how to check which pages of my site that my visitor visiting at the moment


 Hi all, and thanks a lot for the replies since now. I have a new question :

I prepared a simple instant messaging system for my web site and i would like to learn which visitor (registered member) is at which page of my site. 

For example : 

Uid:10000, Username:donald, NameSurname:Donald DUCK is a registered and signed in visitor.

I need the code which tells me that visitor is at which page (ie. images.aspx?imageid=143223)

Sorry for my poor english, and let me know if i should explain more clearly :)

Have a good evening...

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