Most likely missing a code declartion in the code behind. Did you place this
on the page in VS, which should solve that for you, or is this some of your
old code you are replacing?

Signature
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA
*************************************************
| Think outside the box!
*************************************************
>I used to do all my coding in single page DreamWeaver and am now using VS
>2005.
[quoted text clipped - 19 lines]
>
> Tom
when you define a control like:
<asp:linkbutton id="link1" runat="server">
in the aspx class, as class variable named linlk1 is defined, and in the
init code somethink like:
link1 = new LinkButton();
link1.ID = "link1";
...
is generated. when the control is in a repeater, it can not create a
vraiable for the control, because there are 0..n controls. also the control
are created at databind, not during init. the control are children of the
repeator, not the page.
the easiest way to access the controls in a repeater is to use the
OnDataBound event, and use FindControl to access the control. see any
databind examples.
-- bruce (sqlwork.com)
> I used to do all my coding in single page DreamWeaver and am now using VS
> 2005.
[quoted text clipped - 19 lines]
>
> Tom
tshad - 04 Mar 2008 01:22 GMT
> when you define a control like:
>
[quoted text clipped - 16 lines]
> OnDataBound event, and use FindControl to access the control. see any
> databind examples.
That was exactly what I had to do. I needed to do a FindConrol then do an
".OnClientClick".
I guess you don't nee the Attributes.Add anymore.
Thanks,
Tom
> -- bruce (sqlwork.com)
>
[quoted text clipped - 21 lines]
>>
>> Tom
Mark Rae [MVP] - 04 Mar 2008 10:09 GMT
> That was exactly what I had to do. I needed to do a FindConrol then do an
> ".OnClientClick".
>
> I guess you don't need the Attributes.Add any more.
You do for all webcontrols which don't have an OnClientClick property, which
is really only available to Button controls, and to controls which inherit
from Button controls e.g. ImageButton, LinkButton etc. It doesn't exist for
HyperLink controls, etc...

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
tshad - 04 Mar 2008 19:02 GMT
>> That was exactly what I had to do. I needed to do a FindConrol then do
>> an ".OnClientClick".
[quoted text clipped - 5 lines]
> inherit from Button controls e.g. ImageButton, LinkButton etc. It doesn't
> exist for HyperLink controls, etc...
I see.
Thanks,
Tom