i need to access the user control elements such as textbox from parent control.Its showing the error " 'user control' element does not exist in the current context".I cannot access the user control elements??
Asked
Active
Viewed 53 times
1 Answers
0
Let me guess, I think you are trying to get the scope of any control (textbox) which is located inside any other server side view like GridView? You can try this way:
GridViewRow gvr = (GridViewRow)(((Control)sender).NamingContainer);
TextBox _selectedStorageLocation = (TextBox)gvr.FindControl("txtName");
Take a look at this thread as well.