asp.net - how to redirect to another page by using image button in gridview? -


how redirect page using image button placed in gridview checking item template(label) value in other column equal given text.

this code:   protected void page_load(object sender, eventargs e)     {         if (!ispostback)         {             datatable dt = new datatable();             sqldataadapter da = new sqldataadapter("select id,surveyname surveymaster1  union select -1,'select'", con);             da.fill(dt);             dropdownlist1.datasource = dt;             dropdownlist1.datavaluefield = "id";             dropdownlist1.datatextfield = "surveyname";             dropdownlist1.databind();             dropdownlist1.selectedvalue = "-1";         }     }      protected void dropdownlist1_selectedindexchanged(object sender, eventargs e)     {         datatable dt = new datatable();         sqldataadapter da = new sqldataadapter("select question,questiontype questions  surveyid = '"+ dropdownlist1.selectedvalue.tostring() +"'" , con);         da.fill(dt);         gridview1.datasource = dt;         gridview1.databind();     }   protected void imgbtnedit_click(object sender, imageclickeventargs e)     {  gridviewrow grdselrow = gridview1.selectedrow;          textbox textint = (textbox)gridview1.findcontrol("text1");          if (textint.text == "text")         {             response.redirect("text.aspx");         }                 } 

anyone please me.. may question not clear.

protected void imgbtnedit_click(object sender, imageclickeventargs e) {     imagebutton imgbtnedit = (imagebutton)sender;     gridviewrow gr = (gridviewrow)imgbtnedit.namingcontainer;     textbox textint = (textbox)gr.findcontrol("text1");     if (textint.text == "text")     {         response.redirect("text.aspx");     } } 

try code.