I am using a user control which has 2 labels and 1 button. And this user control I am displaying in my main page using listbox.Itemtemplet which makes my user control to show number of time my iteamsource contains ....in my case usercontrol is created for 6 times
But thing here is my button in user control should have events as many times as it loads in my listbox so that I can write some code in codebehind... I think there should be something close to this....
public eventHandler buttonclick;
public usercontrol()
{
InitializeComponent();
testButton.Click +=(s,e) =>
{
if(buttonclick != null )
buttonclick(s,e);
};
please help me I dint find any solution...
But thing here is my button in user control should have events as many times as it loads in my listbox so that I can write some code in codebehind... I think there should be something close to this....
public eventHandler buttonclick;
public usercontrol()
{
InitializeComponent();
testButton.Click +=(s,e) =>
{
if(buttonclick != null )
buttonclick(s,e);
};
please help me I dint find any solution...