[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 888
  • Last Modified:

Sharepoint Web Part error: A control with the specified ID could not be found within the scope of the current naming container.

So I installed a new webpart using stsadm.exe and the webpart shows up fine when I go to add a webpart to a new page on our site. When I add the webprt however, I receive an error page stating:

"A control with the specified ID 'JoinListGridView' could not be found within the scope of the current naming container."

 and I have to go to the web parts maintenance page to remove the webpart from the page. Sggestions? Thanks in advance.
  • 2
1 Solution
You mentioned add a webpart works ok but later when you add -- it gives error? Where does it work and where does it give error?
The issue may be because of ID used in the custom web part. when you add the webpart based on the page nested controls the id of a given control "Join..." may not be same. It could be for example: id="ctl1_ctl100_page_....._JoinListGridView"
To access the id you could use other Id methods available in the control i.e. UniqueId etc.
asphaltninjaAuthor Commented:

It works in that I can actually see the web part in the web part gallery and it lets me add it to the page. I can't actually use the web part once it's on the page though. When I switch to design view in Sharepoint Designer, I see a gray box where the web part is supposed to be and it shows that error.

Also, if I try to publish the page with the web part on it I get the error page and have to go into the web part maintenance page to remove the part and be able to see my page again.

How do I go about accessing the uniqueid control? Do you mean that this is something I must set in the actual webpart tage itself?
Shailaja KumarCommented:
If you are using SPGridView, then i suggest you take a look at the following link for a possible solution,
asphaltninjaAuthor Commented:
Led me in the right direction

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now