>-----Original Message-----
>Either set Enabled=False (it'll be dim) or... in the
render...
Yes, I know about that, that's what I've been doing, but
I don't like having it grayed out... it doesn't look
quite so neat... and organized... as I'd like it to
>Attributes.Add("onClick", "this.checked=" + lcase
(checked.tostring) + ";")
>
>So that if it's enabled or disabled and you don't want
it dim, it'll alsways
>be the value that it started with.
Thanks, friend! That did it! It works perfectly. My
code is now as follows:
Protected Overrides Sub Render(ByVal writer As
System.Web.UI.HtmlTextWriter)
If _readonly Then
MyBase.Attributes.Add
("onClick", "javascript
:" & Me.ID & ".checked=" + LCase
(Checked.ToString) + ";")
End If
MyBase.Render(writer)
End Sub
That adds a SPAN element around the checkbox that
contains the onClick event. I added the "javascript
:"
because I use javascript and vbscript both on this
particular form, and the default page language is
vbscript. "this.checked" doesn't work since it thinks
you're talking about the SPAN element, so I changed it to
use the ID of the control -- and it works great. A
readonly control can only be changed from code, a non-
readonly control can be changed both in code and by being
clicked.
Again, thanks.
--John