Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Visual Studio and HTML templates

  • 12-07-2011 12:23PM
    #1
    Moderators, Home & Garden Moderators, Regional Midwest Moderators, Regional West Moderators Posts: 16,716 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, Registered Users 2 Posts: 16,415 ✭✭✭✭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,716 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: 9,207 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,716 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