Watch videos with subtitles in your language, upload your videos, create your own subtitles! Click here to learn more on "how to Dotsub"

5 Minute Introduction to ASP.NET Web Pages

0 (0 Likes / 0 Dislikes)
  • Embed Video

  • Embed normal player Copy to Clipboard
  • Embed a smaller player Copy to Clipboard
  • Advanced Embedding Options
  • Embed Video With Transcription

  • Embed with transcription beside video Copy to Clipboard
  • Embed with transcription below video Copy to Clipboard
  • Embed transcript

  • Embed transcript in:
    Copy to Clipboard
  • Invite a user to Dotsub
[Microsoft™] [] >>[male voice-over] Web Pages is a fun and simple way to connect to a database or add dynamic server code into some HTML using a new, lightweight syntax called Razor. I'll use WebMatrix to create my page. I can look at my existing sites, I can open a site from an open source web gallery, or create a site from some pre-built templates. We'll create a template using the starter site within WebMatrix. I'll click "Okay," and my site is created and loaded into the WebMatrix application. I can look at the files, databases, and even create reports for things like search engine optimization. I can look at the HTML that makes up my site. "Hello everyone!" And then run my application directly from WebMatrix using Internet Explorer or any of my favorite browsers. I run my app. I can see that my changes are already there. I can also create dynamic applications that pull information from databases. The starter site includes a small database, but I'll create my own. I'll call it "Movies." Then I'll make a table in the Movies database. That table will collect our favorite movies. We'll give our table an ID for each record. The name of the movie. Maybe the release year. And the genre. I'll save my table and call it "Favorites." And then immediately switch into data view. I can start putting in the names of my favorite movies right away. And my data is automatically saved in my database file called movies.stf. I'll switch back over into my HTML. And instead of this static text, I'll want to output my list of movies. I wish my list of movies looked like this. This is a little bit of HTML for my movies list. It's an ordered list with a series of list items, except I typed these movies in myself. I want my data to appear here. So I need to access my database and create my list of movies dynamically. I'll do that by writing a little bit of Razor code. I could open up a new script block or add to an existing one. I'll make a connection to my database using Database.Open("Movies"). Then I'll get my data from my database by querying it ("SELECT * FROM Favorites")—my table name. Now the variable movies has my list of movies. I'll start a new script block with the @ character, and just start writing code for each movie in movies. And output the name of my movie. It's that easy. Notice how I can switch between HTML and script blocks in the same file really seamlessly. It's a lot of fun to write your code in WebMatrix. Let's hit "Run" and see what our page looks like. I can go back to my database. Add another movie. Then return to my browser. Hit refresh. And my data is there. ASP.NET WebPages is a really fun way to get started programming your own ASP.NET website. You can use WebMatrix to talk to a database and use the new Razor syntax for fast and enjoyable development. I hope you enjoy looking around our site. We've got lots of tutorials and videos for you to check out. Thanks a lot and have fun. [Microsoft ASP.NET™] []

Video Details

Duration: 4 minutes and 54 seconds
Country: United States
Language: English
License: All rights reserved
Genre: None
Views: 5
Posted by: neudesicasp on Oct 3, 2013

5 Minute Introduction to ASP.NET Web Pages

Caption and Translate

    Sign In/Register for Dotsub to translate this video.