Link to home
Start Free TrialLog in
Avatar of asphaltninja
asphaltninjaFlag for United States of America

asked on

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.
Avatar of mo1one
mo1one
Flag of United States of America image

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.
 
 
Avatar of asphaltninja

ASKER

Hello,

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?
ASKER CERTIFIED SOLUTION
Avatar of Shailaja Kumar
Shailaja Kumar
Flag of Singapore 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
Led me in the right direction