How to add the HTML script when creating new ASPX page

Discussion in 'ASP .Net' started by Joe Penora, Feb 26, 2007.

  1. Joe Penora

    Joe Penora Guest

    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
     
    Joe Penora, Feb 26, 2007
    #1
    1. Advertising

  2. Joe Penora

    Mark Rae Guest

    "Joe Penora" <> wrote in message
    news:...

    > 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...?
     
    Mark Rae, Feb 26, 2007
    #2
    1. Advertising

  3. Joe Penora

    Joe Penora Guest

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

    <html>

    <head>

    <title>Untitled</title>



    </head>



    <body>

    </body>

    </html>





    "Mark Rae" <> wrote in message
    news:...
    > "Joe Penora" <> wrote in message
    > news:...
    >
    >> 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...?
    >
     
    Joe Penora, Feb 26, 2007
    #3
  4. On Feb 26, 9:29 pm, "Joe Penora" <> wrote:
    > Code like the below to be added into the ASPX page.
    >
    > <html>
    >
    > <head>
    >
    > <title>Untitled</title>
    >
    > </head>
    >
    > <body>
    >
    > </body>
    >
    > </html>
    >
    > "Mark Rae" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > "Joe Penora" <> wrote in message
    > >news:...

    >
    > >> 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...?- Hide quoted text -

    >
    > - 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>
     
    Alexey Smirnov, Feb 26, 2007
    #4
  5. 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.



    Juan T. Llibre, asp.net MVP
    asp.net faq : http://asp.net.do/faq/
    foros de asp.net, en espaƱol : http://asp.net.do/foros/
    ===================================
    "Joe Penora" <> wrote in message news:...
    > Code like the below to be added into the ASPX page.
    >
    > <html>
    >
    > <head>
    >
    > <title>Untitled</title>
    >
    >
    >
    > </head>
    >
    >
    >
    > <body>
    >
    > </body>
    >
    > </html>
    >
    >
    >
    >
    >
    > "Mark Rae" <> wrote in message news:...
    >> "Joe Penora" <> wrote in message news:...
    >>
    >>> 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...?
    >>

    >
    >
     
    Juan T. Llibre, Feb 26, 2007
    #5
  6. Joe Penora

    Joe Penora Guest

    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

    "Alexey Smirnov" <> wrote in message news:...
    > On Feb 26, 9:29 pm, "Joe Penora" <> wrote:
    >> Code like the below to be added into the ASPX page.
    >>
    >> <html>
    >>
    >> <head>
    >>
    >> <title>Untitled</title>
    >>
    >> </head>
    >>
    >> <body>
    >>
    >> </body>
    >>
    >> </html>
    >>
    >> "Mark Rae" <> wrote in message
    >>
    >> news:...
    >>
    >>
    >>
    >> > "Joe Penora" <> wrote in message
    >> >news:...

    >>
    >> >> 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...?- Hide quoted text -

    >>
    >> - 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>
    >
     
    Joe Penora, Feb 26, 2007
    #6
  7. Joe Penora

    Mark Rae Guest

    "Joe Penora" <> wrote in message
    news:...

    > 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...
     
    Mark Rae, Feb 26, 2007
    #7
  8. Joe Penora

    Joe Penora Guest

    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
     
    Joe Penora, Feb 26, 2007
    #8
  9. Joe Penora

    Mark Rae Guest

    "Joe Penora" <> wrote in message
    news:...

    > 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);
    }
     
    Mark Rae, Feb 27, 2007
    #9
  10. Joe Penora

    Joe Penora Guest

    Thanks Mark, that's another way of handling this.
     
    Joe Penora, Feb 27, 2007
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mr. x
    Replies:
    1
    Views:
    1,987
    John Timney \(Microsoft MVP\)
    Nov 30, 2003
  2. John M
    Replies:
    1
    Views:
    1,239
    Kumar Reddi
    May 29, 2005
  3. Stu
    Replies:
    2
    Views:
    807
    Rob McAninch
    Apr 6, 2004
  4. Mike
    Replies:
    2
    Views:
    682
  5. ColdAir
    Replies:
    1
    Views:
    796
    JeffP->
    Feb 26, 2009
Loading...

Share This Page