I am trying to set the CommandArgument property of a Button control from a
template in a DataList of mine using code in the ItemDataBound event.
However, it does not want to set the property (it is acting as if I did not
set it). Here is my code that sets the CommandArgument property in the
ItemDataBound event:
CType(e.Item.Fi ndControl("btnM ainMoveDown"), Button).Command Argument =
CStr(CType(Me.d atMain.DataSour ce, DataTable).Rows (e.Item.ItemInd ex +
1)("id"))
I have tried using a System.Diagnost ics.Debug.Write () statement to make sure
the value I am assigning to the CommandArgument is returning the expected
value, and it is. However, when I try to use the CommandArgument property
through EventBubbling in the ItemCommand event, the e.CommandArgume nt
property has no value. If I set the CommandArgument attribute in the *.aspx
file as an attribute, it has a value, but I need to set it in the
ItemDataBound event. Am I doing something wrong when setting the property?
Why is the property not getting set? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/