[thelist] ASP.NET Adding a linkbutton programmatically

Peter Brunone (EasyListBox.com) peter at easylistbox.com
Mon Aug 7 15:19:22 CDT 2006


   Is lbAlpha_Click a server-side sub or a client-side function?  That's the quickest way to tell which kind of event handler you need.  Since the syntax puts me in mind of server-side naming conventions, you probably want a server-side event handler.  Can you show us exactly what the assignment line looked like before you put in the Attributes approach?


				From: "Casey Crookston" <caseyc at IntelliSoftmn.com>

Tab and Peter,

In my first post I said that lbAlpha.OnClick returned an error, which is
not exactly true. It's just that Visual Studio did not provide OnClick
as an option after typing "lbAlpha."

I confess I am confused by the question you both asked: Am I adding a
client-side or server-side event handler? I was not aware that I had an

But, using:

lbAlpha.Attributes.Add("OnClick", "lbAlpha_Click()")

We never seem to actually get into lbAlpha_Click to execute the code
within. And even if, I'm unsure how to detect the value of the
linkbutton lbAlpha.

I've been googling "asp.net Linkbutton Attributes.Add" and other such
things without any luck. I'm not asking you to do my job for me - just
a nudge in the right direction.



More information about the thelist mailing list