How to add the HTML script when creating new ASPX page

J

Joe Penora

Hi All,

How to add the HTML script when creating new ASPX page. After it is done I
may need to add some Meta tags etc... but the html script is not there.

Is there an option in the ASP.NET that WHEN creating a new aspx page, then
it will generate that basic HTML scrip as well.

Regards,

Joe
 
M

Mark Rae

How to add the HTML script when creating new ASPX page. After it is done I
may need to add some Meta tags etc... but the html script is not there.

Is there an option in the ASP.NET that WHEN creating a new aspx page, then
it will generate that basic HTML scrip as well.

Er, what "HTML script" are you talking about...?
 
J

Joe Penora

Code like the below to be added into the ASPX page.

<html>

<head>

<title>Untitled</title>



</head>



<body>

</body>

</html>
 
G

Guest

Code like the below to be added into the ASPX page.

<html>

<head>

<title>Untitled</title>

</head>

<body>

</body>

</html>







- Show quoted text -

I suppose your ASPX file has

<%@ Page Language="vb" %>

(or c#, etc)

Just add your "HTML script" below, e.g.

<%@ Page Language="vb" %>
<html>
<head>
<title>Untitled</title>
</head>
<body>
</body>
</html>
 
J

Juan T. Llibre

Joe,

if you're using VS.NET or VWD, that basic html is added for you.

If you're creating the file programmatically,
you'll have to add the html script in your code.
 
J

Joe Penora

Hi Alexey,

I have code like the below.

<%@ Page Language="vb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>

And got this message when entered the below html script.
1)
ASP.NET runtime error: Only Content controls are allowed directly in a content page that contains Content controls.
2)
Error 1 Validation (XHTML 1.1): Content is not supported outside 'script' or 'asp:content' regions.

and other messages as well.

Thanks,

Joe
 
M

Mark Rae

I have code like the below.

<%@ Page Language="vb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
</asp:Content>

So this is a content page... the "HTML script" that you seem to think is
missing will be in the MasterPage, and will be rendered when the page is
streamed down to the client...
 
J

Joe Penora

Hi Mark,

That's fine but If I need to add some meta tags for key words etc.. then I can only enter that in the master page?

Thanks,

Joe
 
M

Mark Rae

That's fine but If I need to add some meta tags for key words etc..
then I can only enter that in the master page?

protected void Page_Load(object sender, EventArgs e)
{
HtmlMeta MyMetaData = new HtmlMeta();
MyMetaData.Name = "keywords";
MyMetaData.Content = "word1 word2 word3 word4 word5";
Header.Controls.Add(MyMetaData);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top