I struggled with this for about a day, and there were a lot of sites saying I should just use button.ID or button.UniqueID to set the default button for a panel. Nope, that wasn’t working. Some users were complaining the issue was only occurring on setting default button when in a control contained in a Master page.
The error would be:
The DefaultButton of panel or page must be the ID of a control of type IButtonControl.
So, here’s what you do to fix it:
// Set the default buttons.
((Panel)Page.FindControl(nameofthepanel.UniqueID)).DefaultButton = nameofthebutton.ID;
I hope that helps
Best,
-Auri
same issue
Are you still having the issue after trying my solution, or are you simply saying you had the same issue?
I have the same issue, I use :
pnlDetails.DefaultButton = btnCalculate.UniqueID;
and this works fine in my development environment but when I put it live I get the above error saying ‘The DefaultButton of panel or page must be the ID of a control of type IButtonControl.’
The button is in another panel and in another contentplaceholder
Any idea’s?
Kind regard Suzy
Are you sure your latest code, and ONLY your latest code, has been deployed? Make sure they didn’t simply copy over new files.