Let me explain the reason for writing this article. Many of my friends want to enter Asp.net, but for some reason, it is not so easy, or the books and tutorials I bought are all control-related, some questions may be raised to beginners who want to learn how to create non-control programs. In order to make the new study of Asp.net's non-Control Program Design no doubt, it is the original intention of writing this tutorial.
As I have mentioned earlier, this set of content is mainly for non-control program design. As for the production tools, Visual Studio 2005 (vs2005) and Visual Studio 2008 (vs2008) are similar, then we chose vs2008 to explain how to use the tool. Today, let's talk about the process and precautions for creating solutions and projects.
Creating a website is equivalent to creating a solution. We can understand it as a solution → numerous projects (one of which is the layout of the website ). Let's take an example to illustrate how to create a simple website.
Open vs2008 and select "file", "new", and "project". The following dialog box is displayed.
We have to consider it here. We are going to create several Assemblies. In fact, the project can also be understood as the Assembly name. Create a project named st. page as the running project of the website, and then generate many default files under this project. To do non-control programming, We need to delete default. all the HTML code except the first line of aspx; then the default of the subordinate is deleted. aspx. designer. CS file, because we do not need to design the page.
Then, we need to create another project (although not created, but for program hierarchy, we recommend that you create multiple projects to create different classes) to store the project as a basic variable. The method is simple: Right-click the solution name, select "add" and "New Project", and change the project name. Name it st. base. Because this project is not used to run, but simply to store the project of the program process, we still have something to do: delete app_daTa, default. aspx, and Web. config.
This is basically the process of creation. Only st. Page has other things, and other projects do not have any files or folders. You can add a template folder in the St. Page project to store template files. Method: Right-click the st. Page project name and select "add". Then, options such as "new item" and "new folder" appear. Create a folder named "template ". Next, let's make a simple output: Open the default. aspx. CS file under the st. Page, in the protected void page_load (Object sender, eventargs
E) enter the following content during the process:
- Response.Write("Hello World!");
Press F5 to see the effect! Finally, we will end this talk. Next I will teach you how to use a template class for output.
Address: http://panjunlai.blog.163.com/blog/static/58190301200982454426490/