When mater page is used in Asp.net 2.0, form defaultbutton cannot be set.

Source: Internet
Author: User

Questions

I tried the following methods on the pageProgramAdd:

1 Protected   Override   Void Oninit (eventargs E)
2 {
3Base. Oninit (E );
4Page. Form. defaultbutton= "Btnsearch";
5}

However, an error is prompted on the page and an error is reported.
 

The defaultbutton of 'form1 '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 'form1 'must be the ID of a control of Type ibuttoncontrol.

Source error:

An unhandled exception was generated during the execution of the current Web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack trace:

Do you know which senior personnel have a good solution?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.