ASP.NET 4

Saturday, April 26, 2014

Download the newest version of visual studio here, express is the free version


File new project, asp.net web application


Select web forms project template


Add a label to the about page


In code behind, page load event, assign current time to text property of label


Build app, run it and view the page in the browser, the current time is rendered


Add a new web form with master page to the project


Remove the code behind


In the aspx file, remove the code behind and inherits


Add a label and a c# script block


View the page in the browser


Drop the grid view onto the design surface of the default page


Specify sql database as the data source


Select sql server as the data source


Enter the connection information


Save the connection string


Select the table and columns, click advanced


Select both text boxes


Test the query and click finish


Check enable selection


View in browser, scroll down, select a row, notice postback and taken to top of page


Scroll back down and view selected row is highlighted


In page directives add this attribute and set it to true


Right click file, view in browser, scroll down, select a row, view the scroll position is maintained


In page directives of about page set attribute trace to true


Right click in file and select view in browser


View the tracing information, here stages of page life cycle timed


File new poject, asp.net web application


Choose web forms project template


Default.aspx, design view, select table in menu and add table with four rows and columns


In design view, type in these string literals into the first column and drag two texboxes, one dropdown and one button into the second column


Position cursor after button, hit enter a few times and drag a label onto the design surface


In the source remove the text property of the label and set the id


Set the id's of the other web server controls and the text property of the button to submit


View the page in the browser


In design view highlight the drop down, click the smart tag and select edit items link


Add a couple of countries in the text column


Add a select one item without a value and move it to the top with the arrow


View source, the inputs translated to list items


View the page in the browser


Default Success Warning Important Info Inverse
B S W I ? O