This article is a mirror article of machine translation, please click here to jump to the original article.

View: 15892|Reply: 1

[ASP.NET] mvc UIHint encapsulates custom controls

[Copy link]
Posted on 3/3/2017 5:33:18 PM | | | |
In project development, we often use some public components, such as editors, uploading images, calendars, etc.
In MVC, we can use UIHint to define templates for fields

First we need to know where we put the template file to find it:
There are two folders for DisplayTemplates and EditorTemplates  
The names of these two folders cannot be changed, because the template file is public, so we can put it under Shared in View
Next is how we use templates in View



Wrap the generated html code:

Model:


Custom control code:







Previous:bootstrap input box association prompt
Next:The sweetalert pop-up is loading and the server is processing
 Landlord| Posted on 3/13/2017 3:35:56 PM |
Updated the code:



Solid Model:




Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com