Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > ASP.NET and checkbox

Reply
Thread Tools

ASP.NET and checkbox

 
 
Dave
Guest
Posts: n/a
 
      02-07-2005
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


 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      02-07-2005
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.


 
Reply With Quote
 
 
 
 
Dave
Guest
Posts: n/a
 
      02-07-2005
Doh - thanks Bob!


Dave


"Bob Barrows [MVP]" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASPNET CheckBox and a CheckBox in a TemplateField Jason Huang ASP .Net 0 06-29-2007 12:35 AM
DataGrid and embeded Checkbox..How to find if checkbox clicked =?Utf-8?B?RG90TmV0RGV2?= ASP .Net 1 10-06-2006 04:11 PM
disable checkbox list checkbox Vikram ASP .Net 1 01-25-2006 02:59 PM
Howto bind CheckBox to the datagrid/ Then update the database field when the checkbox is clicked. Joey Pang ASP .Net Datagrid Control 4 06-13-2005 02:29 AM
Text on Checkbox below the checkbox tshad ASP .Net 0 04-14-2005 11:26 PM



Advertisments