To Documents

Creating and Deploying ASP.Net Pages

Creating an ASP.Net Application in Visual Studio

  1. Invoke Visual Studio.
     
  2. Set the .Net Framework to .Net Framework 3.0.
     
  3. Create a new ASP.Net Project: File >> New >> Website. Select New ASP.Net Website on the New Web Site Dialog and set the language to C#. Set the location of the project and click OK. Notice that a new web page has been created named Default.aspx.
     
  4. Select the Design button below the Default.aspx code window.
     
  5. Add drag TextBox and Button controls from the Toolbox onto the Design Window.
     
  6. Resize the controls as desired.
     
  7. In the Properties Window for the TextBox object, change the name to txtNumClicks; change the Text Property to "0" (zero).
     
  8. In the Properties Window for the Button object, change the name to btnClickMe; change the Text Property to "Click Me" (zero).
     
  9. Double click on the Button object to produce the event handler btnClickMe_Click in the code-behind file Default.aspx.cs.
     
  10. In the body of the btnClickMe_Click event handler, enter this code:
  11. Run the application by clicking the Start Button.

 

Deploying an ASP.Net Application

Method A

  1. Immediately before the XHTML validation header
    place these script tags
  2. Copy any event handlers from the Default.aspx.cs code-behind file (for example btnClickMe_Click) to the area between the script tags. Change protected to public for all event handlers.
     
  3. Change the first line of the Default.aspx file from
    to

  4. Delete the Default.aspx.cs and Default.aspx.designer.cs files from the project.
     
  5. Change the name of Default.aspx to the name of the file to be uploaded to the server, for example, click-counter3.aspx.
     
  6. Upload the file from the Step 5 to the server.

Method B

  1. Create and run an ASP.Net project using Visual Studio as described earlier in this document.
     
  2. Create a bin folder in your home directory on the server.
     
  3. Upload the DLL file found in the bin/Debug folder, for example ClickCounter.dll, to the bin folder you created in Step 2.
     
  4. Change the name of Default.aspx to the name of the file to be uploaded to the server, for example, click-counter4.aspx.
     
  5. Upload click-counter4.aspx to the server.