Why doesn't Visual Studio Default.aspx file let me add HTML elements?

0
down vote
favorite

I am confuse about why Visual Studio 2017 doesn’t let me add HTML elements into the Default.aspx, but what I do know is that under the Solution Explorer, I see master page and apparently they are bind to the content page (which is the Default.aspx). Also, I put a copy of my screenshots problems.

So my question is do I start putting content (HTML elements) inside of that master page first!
Aside from what I have mentioned above, I also notice that when I try to put basic HTML elements into the @page directive (Default.aspx file), it says "“Content is not supported outside of ‘script’ or ‘asp:Content’ Regions” ".
The only reason I know of these terms is because I research this problem. Here are the articles that I have researched. “Content Not Supposed to Be Outside ‘Script’ or ‘asp:Content’ Regions” https://msdn.microsoft.com/en-us/library/wtxbf3hh(v=vs.100).aspx

Here are the screenshots of master page and default.aspx files.

My Simple Samples website is a webforms website with a master page. Notice that nearly every page has the same menu on the left. The master page is a master to provide the same format for pages using it. My master page links to stylesheets used by all the pages using it.

Within the header (“head”) element my master page has:

<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder></head>

And in the body it has:

<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>

The first ContentPlaceHolder is for anything I heed to add to the page in the header. All body content goes into the other ContentPlaceHolder. The VS designer shows a box for each ContentPlaceHolder for entering content.

It is more appropriate to say that pages are bound to the master page. My Default.aspx has MasterPageFile=“~/MasterPage.master” in the page directive and I believe that all my aspx files have that attribute.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.