The first or last day of learning ASP. NET MVC

Source: Internet
Author: User

The first or last day of learning MVC.

Today, I want to help my friends solve a few problems! Some of them have nothing to do with MVC. In fact, emails are directly posted.

There are code attachments below;

---------- Email start -------------
1. How to split a project without having to combine Code. For example, petshop MVC is a project by default. If the project is too many and the code is too complex,
Is there a way to do your own work without code? I have nothing to do with one sub-system on my side. I have a bunch of other things that I want them to complete and install them directly at the client.
However, I still have to worry about code integration for existing projects. Sometimes there are few files. Why can they be separated?

A: Yes, of course, but it is not provided by the official team. I did this before (2003 of the time );
 
Splitting the project to be compiled into several proj can solve this problem. If it is MVC
Demo. controllers. u00 -- Public
Demo. controllers. u01 -- developer 1
Demo. controllers. u02 -- developer 2

For petshop, you can use BLL. u01 BLL. u02 and model. u01 model. u02.

The website itself does not need to be split for real-time compilation. You can copy your own page to the website and copy the DLL as above.

If the webapplication method is used, you can split it into webapplication1 webapplication2 webapplication3 as long as the compiled DLL is in the bin
You can copy all files to a virtual directory. Because webapplication is also a class library project, ASP. NET searches for classes that match aspx in all the DLL files in the bin directory.
 
However, the above points may lead to more project files in the namespace, but I think you should be able to endure this;
 
2. Can I convert ASP. NET MVC webapplication to website? This problem is actually related to the one above.WebsiteYou don't need to compile the alive page, but you don't need to add the code of the file!
A: currently, the MVC website template is not officially provided. However, you only need to add the difference section of webapplication web. config to the website
Web. config is basically enough. Ms may be lazy. Dynamic Data provides site templates. It is actually a thing to use with mvc url rewriting,
Both website and webapplication have their own advantages. Different projects can adopt different methods;

3. Can I use the gridview control and other original controls in the ASP. NET MVC project? Can the technical staff of our company tell me no?
A: What technology? Why can't I use it? Do people tell you they don't suggest using it? Are not all Asp.net websites? MVC has many advantages, but sometimes it can save a long time to use controls, because currently many project views
The time for party affairs at the bottom layer should be at most, but there is not much code. In this case, hybrid mode can be used. If viewstate is too large to be disabled, MVC is also a waste of time for a single SQL and a grid page.

4. Can I combine the MVP mode or petshop multi-layer mode in the ASP. NET MVC project?
A: Of course this can be done. You can even use the MVC mixed MVP. For details, see the demo and multi-layer. In fact, it has nothing to do with MVC. You can call it in controller;
There are indeed some advantages for MVPs when there are two people working on the interface and the background. In the demo, there is a mix of MVPs instead of full MVPs. In the MVP mode, I used blogs to have
Do you have so much time to play MVP? I got some fun, so I am so anxious to play so many things? You are not afraid of death !!!

5. Can the controller in the ASP. net mvc default project be moved under the web directory?
A: Of course, you can create a class library project to reference this reference and create a xxxxcontroller under the class library. The MVC Framework will find all the DLL files in the entire bin directory.
The controller must be in the DLL in the bin, and the controller can exist in multiple class libraries. Do not repeat the names (as I expected ), as for the model, you can move it like this. In fact, views
I can also refer to Question 1. Next time I try this kind of problem, I will build a project and put the default controller into it;

It is estimated that the format written in the article notepad is too late ......
There is no time for today. I have time to explain it to you. Today, if we don't do textures, we just need an attachment!

Attachment: Code download

---------- Mail ended -------------

Appendix: You can ignore what you dislike !!!

Although MVC has been installed for a long time, it has not been started once in the computer.
I didn't need this, but a friend asked me a bunch of questions. I didn't know whether to find a typical demo. I sent it to him anyway.
Although MVC has many advantages, I hate it. The writing method on the view layer is too ugly to be accepted. But today, I cannot help my old friend.
In fact, Ms can be used in another way to deal with the view layer. I don't know why I have to do this. I have seen many people in the garden talking about this.
But from the bottom of my heart, I don't think this is really good. Is it about 2.0 better ?? Hope so;

You can control something in a unified manner! He doesn't know where to use webforms.
Didn't you say viewsite! It is also untenable. If it is disabled, it won't be enough.
You can perform unit testing! Can I test the code without putting it on the page? No unit tests are required for the view layer. What is the relationship between this and MVC?
Write the URL! Is it not his patent?
Processing Data first is a little interesting when it reaches the view layer. It is much more convenient to work with WF. Well, this is a bright spot, but it can also be difficult;
Having been engaged in software for so many years, I have always felt that the computer technology field in the whole world has been stagnant over the past few years. I 've been doing something new.
A new name is a new technology. There are only a few products that can make people shine, and there is little creativity in encapsulation.
I always feel that a lot of things are purely fried with cold meals and hypes are absolutely hypes.

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.