Manoj Bisht

Manoj Bisht

  • NA
  • 145
  • 0

Input string was not in a correct format in Rowcommand of a GridView

Feb 9 2009 1:43 AM
Hello Friends,

I've a GridView in which i've taken a LinkButton as TemplateField and that's CommandName is "Play". And now i want to print the index value of the row accordingly the Play button of the GridView's row is clicked.


protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Play")
{
int index = Convert.ToInt32(e.CommandArgument);
Response.Write(index);
}
}

And i'm getting an error Input string was not in a correct format"

Answers (4)