473,469 Members | 1,688 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

74 New Member
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/lib...v=vs.100).aspx

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




Attached Images
File Type: jpg problem 1.jpg (25.7 KB, 392 views)
File Type: jpg problem 2.jpg (47.0 KB, 356 views)
Sep 2 '17 #1
4 4058
dseals22
74 New Member
@Rabbit Do you think you can help me with my problem?
Sep 2 '17 #2
Frinavale
9,735 Recognized Expert Moderator Expert
A MasterPage contains the layout for your website which pages within your application can then use so that your layout is consistent.

Your master page will contain the HTML structure for your site. When you go to the pages within your site (like your Default.aspx page), the content from that aspx page will be used to populate placeholders in your MasterPage.

In your simple case, your Default.aspx uses the SiteMaster master page. This means that the Default.aspx file should NOT contain the <DOCTYPE>, <head> or <body> tags because it is already defined in your SiteMaster.
Sep 5 '17 #3
dseals22
74 New Member
@Frinavale,

Thanks for the advice, but I didn't even have to work with the SiteMaster file for what I was trying to accomplish. All I had to do was drag the control elements in the toolbox of VS into the Designer view of my Default.aspx file. I thought that my initial method of working with the web form was overly complicated and that was why.
Sep 5 '17 #4
Frinavale
9,735 Recognized Expert Moderator Expert
Did you unhook the site from the Default.aspx file?
Or did you remove the <html> tag from your Default.aspx page?

You were getting errors (or warnings) because cannot have 2 <html> tags in your generated HTML...the pictures of the Default.aspx and SiteMaster components that you posted showed that you would have generated invalid HTML.
Sep 11 '17 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: | last post by:
Hello! I have opened a aspx file with visual studio. I see a yellow line and the run etc buttons grayed out. Why is that? Regards Bruno x--------------------- <%@ Page Language="VB"...
2
by: cameron | last post by:
This is probably off topic, so please feel free to redirect me to proper news group, I am wondering if you can enable the XML comments in Visual Studio for other file types. I have written a...
6
by: Jeff Robichaud | last post by:
I've been trying to use a browser other than IE in VS.NET with no success. The default browser on my PC is Firefox, and it is also the default browser for opening web documents from the Solution...
4
by: Charts | last post by:
6/23/05 ..NET Development\Framework\dotnet.framework.aspnet Visual Studio 2005 Beta 2 project cannot work in IIS virtual directory I used Visual Studio 2005 Beta 2 to build a simple new...
1
by: tpirkle | last post by:
I have an html table based form that has textboxes embedded in table rows on it. I wanted to have the textboxes autosize and also have the table rows autosize. To accomplish this, I added a...
1
by: desi.american | last post by:
I have a dynamically generates ASPX page with tables and data. Depending on user selection, the same page can be viewed as a simple web page (rendered in HTML) or as an excel spreadsheet. If the...
4
by: rohinichandrap | last post by:
Hi , I have quite a few questions about Visual Studio :Net 2003 and clear case Could anyone please help me with the answers. I have converted a workspace abc.dsw from visual studio 6 to...
12
by: Nathan Sokalski | last post by:
I recently upgraded to from Visual Studio .NET 2003 to Visual Studio .NET 2005. In Visual Studio .NET 2003 when I would select 'Build' it would add a *.dll with the name of the Project to a /bin/...
5
by: thersitz | last post by:
hi, I have some rented web space -- it is suppose to have asp.net 2.0 loaded. I can drop a default.aspx file in the directory and it will load. Currently in that file i have only basic html --...
3
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, This is an issue that happens to me and everybody else I know and I've never found a way around it. In Visual Studio (currently using 2003 but the same has happened for me in 2005 and...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.