Author: learning.net | Posted on: 11/21/2008 12:18:12 PM | Views : 432

 Hi ,
i have a user control in which i have imagebutton called search. i want to make this as my default button so the users can use enter key instead of clicking the button always.
but its gives the following error
 The DefaultButton of 'mainForm' must be the ID of a control of type IButtonControl.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: The DefaultButton of 'mainForm' must be the ID of a control of type IButtonControl.

all i am doing is in the page_load of the user control i am using the code below
 
protected void Page_Load(object sender, System.EventArgs e)
{
if ( ...

Go to the complete details ...