VS2012 第一個ASP.NET hello word程序

1. New Project --> Visual C# -->Web --> ASP.NET Empty Web Application


2.Right click Project name --> Add --> Web Form


3. add content into hellowordfrom.aspx

     <div>
        <asp:Label id="label1" Font-Size="28px" Font-Bold="True" runat="server" />
    </div>


4. add content into hellowordorm.aspx.cs

protected void Page_Load(object sender, EventArgs e)
        {
            label1.Text = "This is the first asp.net application, Hello World";
        }


5. add content into Web.config

  <system.webServer>
    <directoryBrowse enabled="true"></directoryBrowse>
  </system.webServer>


6. press F5 to run

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章