OK. I screwed up. I posted my message in C# when I'm actually doing VB code.
(I do the majority of stuff in C# but this is in VB.)
Could somebody verify for me that this would be equivalent?
Dim lcbSelect As CheckBox = New CheckBox
lcbSelect.Text = "Selected"
Dim lbSelected As Boolean =
Convert.ToBoolean(dRow("Selected"))
lcbSelect.Checked = lbSelected
lcbSelect.AutoPostBack = True
AddHandler lcbSelect.CheckedChanged, AddressOf
SelectClicked
SelectClicked is defined as
Protected Sub SelectClicked(ByVal sender As Object, ByVal e As
EventArgs)
I'm doing the definition for the checkbox in a call from Pre_Render.
My SelectClicked never gets called.
Anybody have any help?
Again I apologize for putting this in C#.
TIA - an Embarrassed Jeff.
"Jeffrey Hornby" <Je***********@discussions.microsoft.com> wrote in message
news:A0**********************************@microsof t.com...
Write a function with the correct signature (void fn(object sender,
EventArgs
e)) and assign it to the CheckedChanged event. The syntax is like this:
checkbox1.CheckChanged += new EventHandler(this.fn);
The same function can be used for all of your checkboxes. A reference to
the checkbox will be found in the sender argument (you'll need to cast it
to
use it).
--
Jeffrey Hornby
Hornby Consulting, Inc.
"UJ" wrote:
I've got an page that dynamically generates a table (don't ask!) that
includes in each cell a checkbox. I can get the checkbox create but I
can't
figure out how to get an event tied to it so that when the person changes
the value, I get notification.
Also - there appears to be no runat property when I create the checkbox.
Is
this automatically true?
TIA - Jeff.