Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Visual Studio and HTML templates

Options
  • 12-07-2011 12:23pm
    #1
    Moderators, Home & Garden Moderators, Regional Midwest Moderators, Regional West Moderators Posts: 16,722 Mod ✭✭✭✭


    Folks a quick questions.

    But I am doing a small project (10 screens) for a mate of mine, he is going to generate HTML5 screens out of Adobe Dreamweaver and give me them along with CSS.

    I am doing up the project is Visual Studio 2010 as there is a nice bit of backend work to it and thats what I am comfortable with.

    whats the best way to take "in" them HTML pages into an ASPX file in VS2010?

    Or is that a very broad question..

    Cheers


Comments

  • Registered Users Posts: 16,404 ✭✭✭✭Trojan


    I've only done a bit of ASP.NET (more of a LAMP guy) but what I did was rename the HTML to .aspx and embed the code, similar to PHP.

    Example:
    <%@ Page Language="C#" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        protected void btnDoStuff_Click(object sender, EventArgs e)
        {
              try
            {
                    doStuff();
            }
            catch (Exception ex)
            {
                    doOtherStuff();
            }
        }
        
    </script><html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>ASP.NET DoStuff</title>
    </head>
    <body>
        <form id="frmDoStuff" runat="server">
        <div>
            <asp:Button ID="btnDoStuff" runat="server" Text="Do Stuff" 
                onclick="btnDoStuff_Click" />
    ...
    ...
    ...
    </body>
    

    HTH


  • Moderators, Home & Garden Moderators, Regional Midwest Moderators, Regional West Moderators Posts: 16,722 Mod ✭✭✭✭yop


    Thanks lad, I did that there and it looks to work sound.
    Will do some messing around with it and see what it does!

    Thanks v much.


  • Moderators, Science, Health & Environment Moderators Posts: 8,880 Mod ✭✭✭✭mewso


    I prefer my code in it's separate code behind file so I would create a new .aspx file and paste in the contents. Even better create a master page, put the common html in that and the html specific to each page into individual content pages. As it's html5 make sure you have the latest html 5 tools for visual studio.


  • Moderators, Home & Garden Moderators, Regional Midwest Moderators, Regional West Moderators Posts: 16,722 Mod ✭✭✭✭yop


    mewso wrote: »
    I prefer my code in it's separate code behind file so I would create a new .aspx file and paste in the contents. Even better create a master page, put the common html in that and the html specific to each page into individual content pages. As it's html5 make sure you have the latest html 5 tools for visual studio.

    Thanks mewso, the code will be separate.

    I must get the latest HTML5 tools for sure.

    I have a masterpage there, I get you, that makes total sense.

    Thanks


Advertisement