1 / 13

BDPA Day6

BDPA Day6. Learning the fundamentals of ASP.NET. Create an ASP.NET application - Partner1. Start visual studio and create a new Web Site. Name the website Games . Choose the location of X:bdpa where X is your pin drive letter. Note! Partner1 should be driving for this exercise.

dinh
Download Presentation

BDPA Day6

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BDPA Day6 Learning the fundamentals of ASP.NET.

  2. Create an ASP.NET application - Partner1 Start visual studio and create a new Web Site. Name the website Games. Choose the location of X:\bdpa where X is your pin drive letter. Note! Partner1 should be driving for this exercise.

  3. Create a simple web page - Partner1 • Write any kind of text and Click run to see the web page.

  4. Find the Code behind page - Partner2 • Switch seats and let partner2 drive this portion of the program. • Use the Solution Explorer to find and double click on Default.aspx.vb

  5. Create page load function - Partner2 • Use the two drop downs at the top • Select (Page Events) from the left • Select Load from the right

  6. Write hello from VB.NET - Partner2 • Write the following line and hit run on the program • Notice that the web page writes the VB.NET code that you just wrote above the regular HTML on the page. That was because the VB.NET code was writing on the Page Load event.

  7. 99 Bottles of Jolt – Partner 1 • Switch and have Partner1 drive. • Write the 99 bottles of Jolt song in the page load function. This time, the only difference from last week will be the html line endings. (starter code below)

  8. Finish the Bottles of Jolt song - Partner2 • Partner2, please continue the work that Partner1 started and finish the song. • No, you will not get off easy and have the teacher write the code for the song for you. Just try to remember what we wrote last week and finish the song. (while...)

  9. Guessing Game – Partner1 • We’re going to re-create the guessing game as well. • Create a new page • GuessingGame.aspx

  10. Ask for a number – Partner1 • Add the following text to create a number • Hint! You can use the ToolBox and drag a TextBox and a Button onto your code.

  11. Add an event callback for Guess – Partner2 • When viewing the Default.aspx page, Click on the Design tab in the lower left hand corner. • DoubleClick on the Guess button... • And write the following text. Then run the program and try to guess something.

  12. Make the response better – Partner1 • Add a label object to you html page. • Update your GuessButton_Click function to update the label instead of using Response.Write Now you have control over where the output goes on your page.

  13. Finish the Game – Both • For the rest of the day, your goal is to finish the Guessing game using ASP.NET and html. You have to: 1. Generate a random number 2. Create a counter variable and increment it every time the user guesses 3. Add an if statement that helps the user guess higher or lower. 4. Tell the user how many times they took to guess the answer.

More Related