Link to home
Start Free TrialLog in
Avatar of rckrch
rckrchFlag for United States of America

asked on

FindControl in gridview on web page which is on master page.

FindControl will not work when searching for control in gridview which in on master page.  Neither one of the 'Dim ....' options listed below will work.  This is on a master page, but it is in the RowDataBound routine where I am trying to access the control.

Protected Sub SchLayer1GridView_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs)

Dim NewNameDrpDn As DropDownList = CType(e.Row.FindControl("DrpDnName1"), DropDownList)

Dim NewNameDrpDn As DropDownList = DirectCast(e.Row.FindControl("DrpDnName1"), DropDownList)

End Sub

Any help would be appreciated.

Thanks,
ASKER CERTIFIED SOLUTION
Avatar of Chinmay Patel
Chinmay Patel
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Requesting a close as Author has endorsed the comment and technically this is the correct answer.
I am more than happy to explain further or correct my answer if author / moderator objects.