Two asp:content in web content form
Whenever I create a new W开发者_开发百科eb Content Form in asp.net and select a master page. I get two asp:content controls. If I delete the first one the page still works fine.
Is this a bug or a functionality
The master page likely has two placeholder controls. When you select a master page it will give you the template for both, but you are not required to use them both.
If you wanted to delete one, it would be the same as basically leaving the content control empty.
You're master page has 2 content sections.
Deleting one or more from the content page will just make that part of the page empty, which is why there is no error / exception thrown.
If you are not going to use it, might as well get rid of it in your MasterPage file, save that processing power of your server.
精彩评论