ASP.NET and checkbox

D

Dave

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
 
B

Bob Barrows [MVP]

Dave said:
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
 
D

Dave

Doh - thanks Bob! :)


Dave


Bob Barrows said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top