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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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,

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
asphaltninjaAuthor Commented:
Led me in the right direction
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SharePoint

From novice to tech pro — start learning today.