Groups | Blog | Home
all groups > asp.net > april 2004 >

asp.net : Web User Control - calls to server side code


Dan Brussee
4/14/2004 11:24:08 PM
I know, of course that client side stuff cant call server code
directly. What I am doing is putting in a basic LeftHand menu bar
using a user control that contains a datagrid composed of linkbutton
controls. I am populating this either manually (one item at a time
programatically) or via a DataBind to a database table.

How do I link the items to server side code methods? If I had created
the link buttons manually on the page, they would be tied code with
even handlers on their click events dynamically. Im wondering how I
would go about defining this event handler knowing....

A. Visible text for menu item.
B. The name of the method in code that should be called as a result of
clicking on the menu item.

I want to be able to generate all the code to take care of the menu as
I build it, or when I call Databind.

alex
4/15/2004 1:14:27 AM
the datagrid among other controls supports templates where you can specify
an event handler that you have and pass it values if you want like say the
value of column 2 in the current row in the dataset that you are binding the
datagrid to.

[quoted text, click to view]

AddThis Social Bookmark Button