LinkButton ,Label inside Repeater – ASP.NET

Hello All

Today I will show you how to fire  Link Button’s event with argument and initialize a label inside of a repeater. To do that first we have to take LinkButton and a Label control inside the ItemTemplate of the repeater. Then we have to initialize the the Label from OnItemDataBound event of the repeater. In the following code blocks its shown how to perform the job.

Following is my Default.aspx file:

In the above code I have bind the “key” as CommandArgument in LinkButton which will be initialize form the code behind file.

My code behind is as following:

The output will be as bellow:

Selected ID:1
Max [Show]
Top [Show]
Avg [Show]

In the private method section I have created a simple mathod named userInformation, which contains dictionary data collection to bind it with repeater.Hope that above code blocks will help.

Thanks

That’s all for the day.

BYE

User ScrumPad for your Agile based projects.