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

Intro to ASP.NET Web Forms

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® ASP.net] [www.ASP.net] Hi, I'm Scott Hanselman. Let's talk a little bit about ASP.NET Web Forms. It's a familiar model that lets you re-use controls and incorporate data into your website. I'll load up Visual Studio Express, and I'll make a New Project. We'll select ASP.NET Web Application. We'll store a list of people in a database. Here's the default website I get when I make a new Web Forms application. Let's run it and see what it looks like. And our basic application has 2 web pages. I can make my edits in the Source View, or in the Visual Designer. Web Forms uses a visual control model to represent the functionality and the HTML of different elements on your page like grids, text boxes, and buttons. For example, I can drag in a Button and a TextBox. That Button has a series of events like Button Click. In the Button_Click event I might change the TextBox's text. Now I can run my application again, click on my button, and something happens. ASP.NET Web Forms hides a lot of HTML and some of the complexity from you. I'll delete this Button and TextBox. I'll use the entity framework to access my database. Add, New Item, Data, and I'll name my new entity data model "People". I can create an empty model or generate one from a database. I'll use a database that I have on my SQL Express instance called People and save the connection in my WebConfig. My database has a table called People that I'll add to my database model. I can see in the Visual Designer that my Person has First name, Last name, and Age, and that ID is a primary key. If I return to my page and look at my Toolbox, I can see I've got a whole series of controls including controls that manage data. I'll pull in an EntityDataSource and Configure it. Notice that I'm doing everything visually using controls in the surface. I could switch and look at Source code, a Split view, or a Design view if I choose. I'll Configure my Data Source by pointing it to my People database [typing] I'll be using the People EntitySet, and I'll turn on automatic inserts, updates, and deletes. Now I've configured my EntityDataSource, I need a GridView to display the data. I'll point it to my DataSource. Notice that the columns in my database automatically appear in the GridView. I'll want this grid to do Paging, Sorting, Editing, and Deleting. Now I'll drag a DetailsView in so that I can create a form that will allow me to add new items to the grid. I'll choose the same DataSource, Enable Inserting, and I'll look at the properties of my DetailsView. By default it will be ReadOnly, but I'll select Insert so that our controls support inserting new records. I don't need an ID because those are automatically created, so I can edit the Fields, and in this visual dialog, I can remove those Fields and hit "OK". Finally when my DetailsView is done inserting, I'll update the Grid so in the ItemInserted event I'll say GridView.DataBind. Let's run our application and see how it works. I'll type some information in my TextBoxes, hit "Insert", and it appears in my Grid. My Grid is sortable, editable, updateable, and items can be deleted. You can see that ASP.NET Web Forms uses a familiar control model, drag and drop, and visual designers that allow you to create dynamic websites without worrying too much about HTML. This simple demo just shows you the tip of the iceberg. There's a rich ecosystem of controls around ASP.NET Web Form and a lot of resources on the ASP.NET website including videos, tutorials, and sample code. I encourage you to check them out. Have fun! [Microsoft® ASP.net] [www.ASP.net]

Video Details

Duration: 5 minutes and 20 seconds
Country: United States
Language: English
License: All rights reserved
Genre: None
Views: 5
Posted by: neudesicasp on Aug 27, 2013

Scott Hanselman presents a 5 minute introduction to ASP.NET Web Forms.

Caption and Translate

    Sign In/Register for Dotsub to translate this video.