if GridViewCommandEventArgs.CommandName=aa thendim noteid as string'这里如何写 Dim index As Integer= ????????????????noteid=GridView1.DataKeys(index).Value.ToString()end if
int index = Convert.ToInt32(e.CommandArgument);
楼上的,我也用你的方方法,但是报错啊 Input string was not in a correct format. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.FormatException: Input string was not in a correct format.
int index = Convert.ToInt32(e.CommandArgument.ToString()); 就不会了
Dim index As Integer= ????????????????noteid=GridView1.DataKeys(index).Value.ToString()end if
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.FormatException: Input string was not in a correct format.
就不会了
在线等待中......
你用: DataView1.DataKeys[e.Item.Index] 可以取得主键值,
你想取那一行的主键值,利用DataKeys[当前行的索引] 就可以取到