Web User Control - calls to server side code

D

Dan Brussee

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.

TIA
 
A

alex

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top