Hi,
Globally i want to find a textbox which is in a gridview such that i
can use that variable in any of the events.
Is that possible in .cs file
or
if not how can we retreive the variable of a textbox in to a function
after finding the textbox using javascript in .aspx page .
I tried to find a control in .cs file but I couldn't get it.
Please, give the solution.
Loading
ArshadPosted Jul 8, 2010, 4:46 AM
After the DataBind you loop into the gridview, and try to find the control like below.
for(int i=0;i<=grdv.rows.count-1;i++)
{
TextBox txtFind=new TextBox();
txtFind=grdv.rows[i].FindControl("txtFind");
// Like this you can find the control in side the gridview. This is not tested code, i just given you the logic, try to do the same.
}
Regards,
Arshad.