Monday, September 9, 2013

ASP.NET 2.0: myproject101

-----
-----



This tutorial uses UltiDev WebServer Pro for running ASP .NET 2.0 applications. To learn more on setup steps, follow this tutorial, http://setup-steps.blogspot.com/2013/07/aspnet-development-environment.html.



1) Create the physical directory for myproject101, C:\Z\aspnet2\sites\myproject101\


2) Using Notepad++, create aspx file C:\Z\aspnet2\sites\myproject101\index.aspx containing the following code:
<h1>Hello World</h1>



3) Create Virtual Host for myproject101
a) Run UltiDev/Web Server Pro/Interactive Dev & Test Server/UWS for .NET 1.x, 2.0, 3.x


b) The Control Panel pops up.
Enter the following details:


c) Click Exec Control button.


d) New links appear beside the button.


e) Click on the link http://localhost:80/myproject101/
A webpage appears on the screen.
Notice that the address box showing the URL similar to the link in the previous step.



4) Create a new aspx file, C:\Z\aspnet2\sites\myproject101\testvb.aspx 
a) Enter the following codes:


Data provided by Pastebin.com - Download Raw - See Original
  1. <html>
  2. <head>
  3. <title>My First ASP.NET Page</title>
  4. <script runat="server" language="VB">
  5. Sub Page_Load(sender As Object, e As EventArgs)
  6. timeLabel.Text = DateTime.Now.ToString()
  7. End Sub
  8. </script>
  9. </head>
  10. <body>
  11. <p>Hello World!</p>
  12. <p>The time is now:
  13. <asp:Label runat="server" id="timeLabel" /></p>
  14. </body>
  15. </html>
b) Browse URL http://localhost:80/myproject101/testvb.aspx



5) Create a new aspx file, C:\Z\aspnet2\sites\myproject101\testcs.aspx
a) Enter the following codes:


Data provided by Pastebin.com - Download Raw - See Original
  1. <html>
  2. <head>
  3. <title>My First ASP.NET Page</title>
  4. <script runat="server" language="C#">
  5. protected void Page_Load(object sender, EventArgs e)
  6. {
  7. timeLabel.Text = DateTime.Now.ToString();
  8. }
  9. </script>
  10. </head>
  11. <body>
  12. <p>Hello there!</p>
  13. <p>The time is now:
  14. <asp:Label runat="server" id="timeLabel" /></p>
  15. </body>
  16. </html>
b) Browse the URL http://localhost:80/myproject101/testcs.aspx


6) Create a new aspx file, C:\Z\aspnet2\sites\myproject101\formvb.aspx
a) Enter the following codes:


b) Browse the URL http://localhost:80/myproject101/formvb.aspx


7) Create a new aspx file, C:\Z\aspnet2\sites\myproject101\formcs.aspx
a) Enter the following codes:


b) Browse the URL http://localhost:80/myproject101/formcs.aspx