• MVC 4 using pagedlist.mvc paging implementation code


    There are many ways to paginate in MVC. Pagedlist and pagedlist.mvc are provided in nuget. When you install and reference pagedlist.mvc, you will also install and reference pagedlist. Copy codeThe code is as follows:  @Html.PagedListPager((PagedList.IPagedList<SampleInfo>)ViewBag.Models, page => Url.Action(“Index”, new { page, keyword = Request[“keyword”], datemin = Request[“datemin”], datemax = Request[“datemax”] })) Search trigger event: […]

  • How to use log4net under. Net


    This example for you to share the. Net log4net use, for your reference, the specific content is as follows Take the console application as an example First, add a reference: After installation, you can see that there are more references to log4net in the project: Add application configuration file app.config and configure log4net <?xml version=”1.0″ […]

  • ASP. Net mvc4’s idea of updating form content through ID


    User requirements: once a form is created, most of its fields can no longer be edited. Only some of the fields can be edited. Non editing is realized by setting the disabled attribute to the input box. At this time, an error will be reported to the content of the submit form in the database, […]

  • programming simple method to generate static pages


    In this paper, an example is given to show how to generate static page by programming. The details are as follows: 1. Use scenarios When the data of the page does not need to be changed frequently, the static page mode can be adopted. 2. Benefits of using static pages (1) Speed up website […]

  • How to use quartz. Net under. Net

    Time:2021-6-10 is a job scheduling framework. The details are as follows 1. Add the reference of to the project (nuget management is used here) Create a new class, timingjob, which is mainly used to implement task logic using Quartz; using System; namespace QuartzNetDemo { /// <summary> ///Timing task class /// </summary> public class TimingJob […]

  • Example of generating verification code function realized by [demo source code attached]


    This paper introduces the function of generating captcha by The details are as follows: The principle of generating verification code: generate random characters, generate the characters into pictures, and store them in session at the same time, and then verify whether the content entered by the user is consistent with the verification code in […]

  • Visual Studio (vs2017) configures C / C + + postgresql9.6.3 development environment


    development environment Visual Studio 2017[15.2(26430.16)] Download address: Developer download address: PostgreSQL 9.6.3 Download address: Configuration steps First, download the required version of PostgreSQL from the URL above. There are 32-bit and 64 bit options here. The number of bits here refers to the number of bits of the software you developed by calling PostgreSQL, not […]

  • access to the client browser to access the IP address instance code


    This paper introduces the access to the client browser to access the IP address of the example code, to share with you, I also leave a note 1. JS method <!DOCTYPE html> <html> <head> <meta charset=”UTF-8″ /> <title>Document</title> <script src=”″></script> <script type=”text/javascript”> Document. Write (‘Ip address: ‘+ returncitysn [“CIP”] +’, City Code: ‘+ returncitysn […]

  • How. Net uses cache framework to add cache to program


    Net 4.0 adds a new system.runtime.caching namespace, which provides a series of extensible cache framework. This paper briefly introduces how to use it to add cache to programs. A cache framework mainly includes three parts: objectcache, cacheitempolicy and changemonitor. ObjectCacheRepresents a cache pool, which provides interfaces for adding, obtaining, and updating cache objects. It is […]

  • MVC httppostedfilebase file upload instance code


    This paper introduces the MVC httppostedfilebase file upload, share to you, hope to help you Httppostedfilebase file upload, support multi file upload at one time, if there is a picture, support to save the thumbnail Encapsulation of file transfer information /// <summary> ///File generation method /// </summary> public class UpFileMessage { /// <summary> ///File […]

  • MVC uses pagedlist.mvc to achieve paging effect


    In the last articleDB first of EFThere are two problems in this paper 1. The add / edit page displays the attribute name, not the custom name (such as name, major…) 2. Validation is not added when adding / editing 3. Pagination is used for data display @HTML. Labelfor (model = > model. Name, htmlattributes: […]

  • Detailed explanation of DB first mode of Entity Framework


    EF (abbreviation of Entity Framework, the same below) has three ways: database first, model first and code first. Here’s how DB first works: 1. There are two tables in the database, one is the specialty table and the other is the student table. A student can only belong to one specialty Where t_ Major is […]