At first I was getting an error: accountRequestsViewer does not exist in the current context. This seems to be due to the fact that the accountRequestsViewer is in my asp:loginview.
there are two grid with same name. Is it possible for you to use different names? If not put panel with different Ids and find the panel control first and then find the grid from that control again
According to your description, it seems like that you want to bind the gridview in the loginview. As far as I know, when we want to find the control in the loginview control, you need to use
findcontrol method and make sure that the control is in the
active template. You can't access the control in the no-active template. Thus, if you want to find the "accountRequestsViewer" in the Role1, please make sure that Role1 is in active state at first. Then use findcontrol to find the GridView . Please
check the similar threads below:
wtholmes
Member
1 Points
6 Posts
Accessing GridView Control when it is in a RoleGroup Content Template.
Jun 29, 2012 08:50 PM|LINK
alvingeorge
Participant
925 Points
203 Posts
Re: Accessing GridView Control when it is in a RoleGroup Content Template.
Jun 29, 2012 09:20 PM|LINK
there are two grid with same name. Is it possible for you to use different names? If not put panel with different Ids and find the panel control first and then find the grid from that control again
Catherine Sh...
All-Star
23382 Points
2490 Posts
Microsoft
Re: Accessing GridView Control when it is in a RoleGroup Content Template.
Jul 06, 2012 07:35 AM|LINK
Hi wtholmes,
Thank you for posting.
According to your description, it seems like that you want to bind the gridview in the loginview. As far as I know, when we want to find the control in the loginview control, you need to use findcontrol method and make sure that the control is in the active template. You can't access the control in the no-active template. Thus, if you want to find the "accountRequestsViewer" in the Role1, please make sure that Role1 is in active state at first. Then use findcontrol to find the GridView . Please check the similar threads below:
http://forums.asp.net/p/1817493/5040570.aspx/1?Re+FindControl+Issue
http://stackoverflow.com/questions/372158/findcontrol-in-a-rolegroup-in-a-loginview
In addition, if it doesn't resolve your issue, please debug your code an find whether the viewRequestsLoginView is null.
Best wishes,
Feedback to us
Develop and promote your apps in Windows Store
sukumarraju
All-Star
17337 Points
3057 Posts
Re: Accessing GridView Control when it is in a RoleGroup Content Template.
Jul 06, 2012 10:14 AM|LINK
Refer my blog article
http://weblogs.asp.net/sukumarraju/archive/2011/01/31/find-control-with-in-loginview-control.aspx
Application Architecture Guide 2.0
My Blog
Twitter