Showing posts with label command argument. Show all posts
Showing posts with label command argument. Show all posts

Wednesday, January 8, 2014

Get data from repeater using CommandName and CommandArgument

Hi everyone,
previously I gave an example of how to get data from a repeater using javascript. Today I am going to describe how to retreive data from repeater using CommandArgument and CommandName.

CommandName and CommandArgumet are two different properties of a ASP server button and using those two we are doing this example.

<asp:Button ID="btn_details" runat="server" Text="Show Id"   CommandName="edit" CommandArgument='<%# Eval("ContactID") %>'/>

Here in the button, which is within the repeater, we are binding the CommandArgumet with the ID of the data table. And when ever the button is clicking the value is passing and with that ID you can do your necessary work(edit, delete etc.).

Popular Posts

Pageviews