About resource sharing for ASP. NET Video Tutorials

Source: Internet
Author: User
The ASP. ASP. NET is a development framework for creating Web pages and Web sites using HTML, CSS, JavaScript, and server scripting. Three different development modes are supported by asp: Web pages (Web pages), MVC (Model View Controller models-View-Controller), Web Forms (Web Forms): Web pages single page mode MVC model-View-controller Web Forms Event-driven mode

Course Play Address: http://www.php.cn/course/83.html

The teacher's lecture style:

Teachers teach in a clear, well-organized, layered analysis, interlocking, rigorous argumentation, structural rigorous, with the logical power of thinking to attract students ' attention, with reason to control the course of classroom teaching. By listening to the teaching of teachers, students not only learn knowledge, but also receive the training of thinking, but also by the teachers rigorous study attitude of edification and infection

The more difficult part of this video is the Web Pages:

Three programming models Web Pages, Web Forms, and MVC (model, View, Controller)

Web pages is the simplest programming model for ASP. It provides an easy way to combine HTML, CSS, JavaScript, and server code:
Easy to learn, read and use
Build around a single Web page

Similar to PHP and ASP

Server scripts use Visual Basic or C #
Full control over HTML, CSS, and JavaScript

Web Pages are extended through a programmable web Helpers, including databases, videos, images, social networks, and more.

Razor Web pages can be described as HTML pages with two kinds of content: HTML content and Razor code.

When the server reads this page, the Razor code is run first before the HTML page is sent to the browser. The code that executes on the server can accomplish tasks that cannot be done in the browser, such as accessing the server database. Server code can create dynamic HTML content before the page is sent to the browser. From the browser, the HTML generated by the server code is no different from the static HTML content.

Layouts (such as headers and footers).

Through the Web Pages, you can import content from different files using the @RenderPage () method.


A layout page layout page is used like a normal web page, but the @RenderBody () method is called at the point where the content page is referenced. Each content page must start with the Layout directive. In the code is this: layout page:


Any page:

@{layout= "layout.cshtml";}  

ASP. NET provides three tools for working with folder paths: The ~ operator, the Server.MapPath method, and the Href method.

~ operator

To specify the virtual root directory in your programming code, use the ~ operator.

If you use the ~ operator instead of a path, you can move the Web site to a different folder or location without changing any code:

var myimagesfolder = "~/images"; var mystylesheet = "~/styles/stylesheet.css";

Server.MapPath method

The Server.MapPath method transforms the virtual path (/default.cshtml) into a physical path (C:\Johnny\MyWebSited\Demo\default.cshtml) that the server can understand.

You will use this method when you need to open a data file located on the server (the data file can only be accessed through the full physical path):

var pathName = "~/datafile.txt"; var fileName = Server.MapPath (pathName);
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.