The code you posted doesn't refer to an existing LinkButton. You haven't
instantiated one, just created a variable of that type. You didn't mention
what error message you're getting, but my guess would be "Object reference
not set to an instance of an object."
In addition, the LinkButton must be added to the Page Controls somehow.
--
HTH,
Kevin Spencer
Microsoft MVP
..Net Developer
The sun never sets on
the Kingdom of Heaven
"WebBuilder451" <We***********@discussions.microsoft.com> wrote in message
news:D7**********************************@microsof t.com...
I'm trying to add an event handler to the on click event of an existing
link
button.
here is the code:
Dim thscc As LinkButton
dWrk = dtrCal("calDate")
thscc.onClick = New EventHandler(AddressOf cc_onClick)
the .onClick is erroring out. I think i have the right idea but , ....
also if i add an event to an existing item will it need to be recreated on
each post back like a dynamicly created link button?
thanks
kes