ASP.NET and checkbox

Discussion in 'ASP General' started by Dave, Feb 7, 2005.

  1. Dave

    Dave Guest

    Hi all,

    I'm new to ASP.NET and am working through a few exercises in a book to get
    up to speed. First, some background:

    I'm running SQL Server 2000 and have one field as a bit data type (0=false
    or 1=true). On a form I have a check box that a user can check for whatever
    reason. This field saves properly to the DB.

    However, my problem is in editing the field. When I click a link to update
    a record, the checkbox is always unchecked. If I leave it unchecked it
    updates the field to show as false. I can't seem to get it to enable based
    on the data from the dataset. it looks like I've got it set to dynamic as
    well (I'm using Dreamweaver to develop).

    In the parameter tag I have this:

    <Parameter Name="@access" Value='<%# IIf((Request.Form("EditPages") <>
    Nothing), Request.Form("access"), "") %>' Type="Boolean" />

    And for the actual checkbox I have:

    <asp:checkbox id="EditPages" runat="server" checked='<%#
    IIf((dsUpdate.FieldValue("EditPages", Container) = "1"), true, false) %>' />

    Now, again - new to ASP.NET (.NET in general) and I can't follow this logic.
    An someone walk me through it? Also - why are If statements IIF (with 2
    I's?)

    Thanks for your newbie patience! :)

    Dave
     
    Dave, Feb 7, 2005
    #1
    1. Advertising

  2. Dave wrote:
    > Hi all,
    >
    > I'm new to ASP.NET and am working through a few exercises in a book
    > to get up to speed. First, some background:
    >

    There was no way for you to know it, but this is a classic asp newsgroup.
    While you may be lucky enough to find a dotnet-savvy person here who can
    answer your question, you can eliminate the luck factor by posting your
    question to a newsgroup where the dotnet-savvy people hang out. I suggest
    microsoft.public.dotnet.framework.aspnet.

    HTH,
    Bob Barrows
    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
     
    Bob Barrows [MVP], Feb 7, 2005
    #2
    1. Advertising

  3. Dave

    Dave Guest

    Doh - thanks Bob! :)


    Dave


    "Bob Barrows [MVP]" <> wrote in message
    news:%...
    > Dave wrote:
    >> Hi all,
    >>
    >> I'm new to ASP.NET and am working through a few exercises in a book
    >> to get up to speed. First, some background:
    >>

    > There was no way for you to know it, but this is a classic asp newsgroup.
    > While you may be lucky enough to find a dotnet-savvy person here who can
    > answer your question, you can eliminate the luck factor by posting your
    > question to a newsgroup where the dotnet-savvy people hang out. I suggest
    > microsoft.public.dotnet.framework.aspnet.
    >
    > HTH,
    > Bob Barrows
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
     
    Dave, Feb 7, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tshad
    Replies:
    0
    Views:
    565
    tshad
    Apr 15, 2005
  2. Vikram

    disable checkbox list checkbox

    Vikram, Jan 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    1,424
    ThunderMusic
    Jan 25, 2006
  3. =?Utf-8?B?RG90TmV0RGV2?=

    DataGrid and embeded Checkbox..How to find if checkbox clicked

    =?Utf-8?B?RG90TmV0RGV2?=, Oct 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    858
    David Wier
    Oct 6, 2006
  4. Jason Huang
    Replies:
    0
    Views:
    581
    Jason Huang
    Jun 29, 2007
  5. Joey Pang
    Replies:
    4
    Views:
    550
    Joey Pang
    Jun 13, 2005
Loading...

Share This Page