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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Visual Studio and HTML templates

  • 12-07-2011 11:23am
    #1
    Moderators, Home & Garden Moderators, Regional Midwest Moderators, Regional West Moderators Posts: 16,724 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,414 ✭✭✭✭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,724 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,035 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,724 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