The DefaultButton of 'panEdCrit' must be the ID of a control of type IButtonControl ???


I have an ASP.Net project that contains the following line:

panEdCrit.DefaultButton = butType1Search.UniqueID

On my development PC this works fine, and the default button within the panel panEdCrit is set to butType1Search

When I upload this to the web server I get the following error:

The DefaultButton of 'panEdCrit' must be the ID of a control of type IButtonControl.

What's going on, and how do I fix this?


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.

Which type of control is butType1Search?
rpmAuthor Commented:
<asp:Button ID="butType1Search" runat="server" Text="Search" />
Is panEdCrit inside another panel? I remember seeing there was a problem with nested containers and default buttons.
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

rpmAuthor Commented:
The panel isn't inside anything else, but there is a multiview inside the panel, and the button is inside that.

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
rpmAuthor Commented:
Based on that article, I tried setting the DefaultButton for the root form, rather than the panel, and that worked.

Thanks for your help.
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

From novice to tech pro — start learning today.