c# - gridview button -


i apologize if real simple question, can't find else ask. have gridview button column. i'm trying use button column send filename page. pulled code off of solution here, error: "does not contain definition 'item'" on line: listviewdataitem item = (listviewdataitem)e.item; , have no idea using-namespace (is called?) use.

protected void gvfiles_rowcommand(object sender, system.web.ui.webcontrols.gridviewcommandeventargs e) {      if (e.commandname == "edit")     {         listviewdataitem item = (listviewdataitem)e.item;          int index = item.dataitemindex;         string fileid = ((listview)sender).datakeys[index]["fileid"].tostring();          response.redirect("irmain.aspx?@filename=" + fileid);     } } 

i suppose dealing gridview not listview, code should

protected void gvfiles_rowcommand(object sender, system.web.ui.webcontrols.gridviewcommandeventargs e)  {       if (e.commandname == "edit")      {          int index = convert.toint32(e.commandargument);         string fileid = ((gridview)sender).datakeys[index]["fileid"].tostring();          response.redirect("irmain.aspx?@filename=" + fileid);      }  }  

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -