PDA

Click to See Complete Forum and Search --> : Multiple CommandArguments in a DataList


jstansell
Feb 25th, 2004, 03:05 PM
Is this possible?

I have a DataList control that has its OnItemCommend set to an Event Handler in the code behind. This works great. But what I now need to do, is when the user clicks on a Link Button I need to send two CommandArguments. Is there a way to do this?

<asp:LinkButton
id=Linkbutton3
runat="server"
CommandArgument='<%# DataBinder.Eval(Container.DataItem, "ModelNumber") %>'
CommandName="AddQuantity"
Text="Add">
</asp:LinkButton>

The code above works fine, but I now need to also send to the event handler the quantity value that is also in the Datasource.

Thanks!

pvb
Feb 25th, 2004, 07:15 PM
I usually use a value separated list, like separate the two args you want to pass in by comma or whatever character, then split arg value in the eventhandler.