Search code examples
asp.netmaster-pagescontentplaceholder

change the ContentPlaceHolder's ID


I have a master page. in this master page I have a content place holder with id="ContentPlaceHolder1" I changed this to id="main-content" then change the ContentPlaceHolderID of any content page that created with this master page but I have an error:

'main-content' is not a valid identifier.

what should I do?


Solution

  • You can not use "-" in your ID. you can use

    main_content

    or

    maincontent