Category:ASP.NET

  • Asp.net MVC 4 using pagedlist.mvc paging implementation code

    Time:2021-6-14

    There are many ways to paginate in asp.net 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

    Time:2021-6-13

    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

    Time:2021-6-12

    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, […]

  • Asp.net programming simple method to generate static pages

    Time:2021-6-11

    In this paper, an example is given to show how to generate static page by asp.net 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

    Quartz.net is a job scheduling framework. The details are as follows 1. Add the reference of quartz.net 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 asp.net [demo source code attached]

    Time:2021-6-9

    This paper introduces the function of generating captcha by asp.net. 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

    Time:2021-6-8

    development environment Visual Studio 2017[15.2(26430.16)] Download address:https://www.visualstudio.com/downloads/ Developer download address:https://www.jb51.net/softs/540849.html PostgreSQL 9.6.3 Download address:https://www.enterprisedb.com/downloads/postgres-postgresql-downloads 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 […]

  • Asp.net access to the client browser to access the IP address instance code

    Time:2021-6-7

    This paper introduces the asp.net 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=”http://pv.sohu.com/cityjson?ie=utf-8″></script> <script type=”text/javascript”> Document. Write (‘Ip address: ‘+ returncitysn [“CIP”] +’, City Code: ‘+ returncitysn […]

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

    Time:2021-6-6

    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 […]

  • Asp.net MVC httppostedfilebase file upload instance code

    Time:2021-6-5

    This paper introduces the asp.net 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 […]

  • Asp.net MVC uses pagedlist.mvc to achieve paging effect

    Time:2021-6-4

    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

    Time:2021-6-3

    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 […]