0

hi all. i've been doing a checkbox that is controlled by bitmaps.
it is successful when i checked the check box and updated it. but it is not successful when i try to uncheck and update it. it will be as if it was checked like before.

below is my coding

Dim ItemCount As Integer = 3
        Dim Total As Integer = 0

        For i = 0 To ItemCount
                   Dim chk As CheckBox = Page.FindControl("cb" & StringValue & i.ToString)
            If chk.Checked Then
              
                Total = Total + RefNo(i)

            End If

        Next i

        Return Total

thanks

3
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by mIssy_ricco
0

does u r code compile correctly..?

cos i'm a C# coder if i'm at ur place...

i need to typecast the things before referencing any checkbox on the page ...

if u r code complies correctly then wot is error u get...elaborate please.. may be i can help...

0

hi all. i've been doing a checkbox that is controlled by bitmaps.
it is successful when i checked the check box and updated it. but it is not successful when i try to uncheck and update it. it will be as if it was checked like before.

below is my coding

Dim ItemCount As Integer = 3
        Dim Total As Integer = 0

        For i = 0 To ItemCount
                   Dim chk As CheckBox = Page.FindControl("cb" & StringValue & i.ToString)
            If chk.Checked Then
              
                Total = Total + RefNo(i)

            End If

        Next i

        Return Total

thanks

Your question is not clear.

You are summing up some values for the checked items. Also you posted the code segment partially. What do you expect for the uncheck items ?

0

what i am trying to do is to total up the value of all the checkboxes. but when it is checked it is updates successfully.

but when i display all of the checkboxes again and want to uncheck certain boxes the value will still be as if it was checked.

0

does u r code compile correctly..?

cos i'm a C# coder if i'm at ur place...

i need to typecast the things before referencing any checkbox on the page ...

if u r code complies correctly then wot is error u get...elaborate please.. may be i can help...

yes...all the compilation is ok. no errors. just that when i want to uncheck it won't update into the server. the bitmap is calculated as if it is checked.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.