Radio Button when checked evaluates to true?????

S

Steven

I have a real strange page built with framework 1.1 vb asp.net

On this page I have a set of radio buttons.
---------------
Protected WithEvents rbStandard As
System.Web.UI.WebControls.RadioButton
Protected WithEvents rbCustom As System.Web.UI.WebControls.RadioButton
---------------
When you select one of the buttons and post the page back to the server
with a break point where I read the checked property, it is false.
However, when it passes the line of code where it ask "if
rdostandard.checked = true then..." it always evaluates this as true
and does the ...

If I "dim test as string" and then "test =
rdostandard.checked.tostring" and and check the value in test it is
"FALSE". Then I run the code "If ucase(test) = "TRUE" then...." it
does the ....
---------------
Dim test As String

test = rbStandard.Checked.ToString

If UCase(test) = "TRUE" Then TotalPercent = Round(TotalPercent, 0)

'If rbStandard.Checked = True Then TotalPercent = Round(TotalPercent,
0)
 
P

Patrice

Just does a test page that write down the boolean value and tell us also in
which event you do that... Make sure also you don't reinit again the control
somewhere...

As a side note, though this is not a problem a boolean value is already
true/false in itself (you could use If MyValue Then rather than If
MyValue=True Then...)

Patrice
 

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,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top