C ා use await to call button event handler asynchronously

Click the button to implement asynchronously to realize the non blocking state of the interface.The asynchronous development mode recommended in C ා uses async to prompt for possible asynchronous operations, and await keyword to wait for tasks to wait for asynchronous operations.For the methods with Async suffix provided in. net library, await ...

Added by shooff2332 on Tue, 12 May 2020 17:36:54 +0300

Asp.net MVC simple implementation generate Excel and download

Due to the requirements on the project, you need to export the Excel file with the specified conditions. After a rummage, it finally came true. Now post the code and share it (directly share the code of some auxiliary classes in our project)   Our project uses Asp.Net MVC4.0 mode. Each ActionResult must return a View or Json, etc. (the paramete ...

Added by busterbry on Sun, 03 May 2020 03:07:20 +0300

ASP.NET open source import and export library used in Magicodes.IE Docker

Magicodes.IE used in Docker Update history 2019.02.13 Update Nuget to 2.0.2 [import] to repair the single column imported Bug, unit test "onecolumnimporter" '. See you. https://github.com/dotnetcore/Magicodes.IE/issues/35). [export] fixed the problem of template compiling and error reporting in some cases when exporting HTML, Pdf and ...

Added by fsumba on Sat, 15 Feb 2020 18:41:12 +0200

How to write an application of asp.net as a websocket server

Recently, a problem with WebSockets has plagued me for a long time. One requirement is to set up a websocket service on a web site.The client establishes a connection with the server through a web page, and the server sends information to the client web page based on ip. In fact, this requirement is not difficult, but at first you don't know mu ...

Added by markmil2002 on Fri, 14 Feb 2020 05:44:02 +0200

C ා MVC global error processing in application ා error (including Ajax request)

Deal with global errors in global.asax application? Error of MVC. If an error is reported before the request object is created, Context.Handler == null. When judged to be an Ajax request, we return the Json object string. When not an Ajax request, go to the error display page. /// <summary> /// Global error /// </summary> /// <p ...

Added by introvert on Thu, 09 Jan 2020 17:20:04 +0200

[UWP]UIElement.Clip is disabled, but it can play as well

1. Review the UIElement.Clip for WPF WPF has been around for a long time, but hardly ever actively uses its Clip property. I only remember that it is flexible enough to cut out many shapes.stay Official Documents After a review, the general usage and effect are as follows: <Image Source="sampleImages\Waterlilies.jpg" Width="200" Heigh ...

Added by Cynix on Sat, 04 Jan 2020 16:04:43 +0200

How to receive Json data by MVC

public class DemoModel { public string Name { get; set; } public int Age { get; set; } } [HttpPost] public ActionResult About(DemoModel model) { return Json(model); } [HttpPost] public ActionResult About(string Name, int Age) { return Json(model); } See if this code is very familiar. It's commonl ...

Added by Batosi on Fri, 03 Jan 2020 19:08:42 +0200

SignalR2 simple data Kanban demonstration

Software environment: 1,vs2015,windows7,.net4.5 Presentation: When the button is clicked, the histogram value is increased by 1 and changes in real time 1. First open vs2015 to create an mvc project and install SignalR2. For details, please refer to: http://net-yuan.com/Article/Detail/e407a472-338a-458d-9d7a-4a9e43fd2da5 2. Right click the pro ...

Added by cronus on Sun, 08 Dec 2019 01:53:48 +0200

Use SMTP in System.Net.Mail to send mail (with attachments)

System.Net.Mail Use Simple Mail Transfer Protocol SMTP to send mail asynchronously To implement SMTP to send mail, you need to understand these classes SmtpClient: use the profile settings to initialize a new instance of the SmtpClient class. It contains the following properties: Host: set the host name or host IP used for SMTP service; Port: s ...

Added by nesargha on Tue, 03 Dec 2019 22:43:45 +0200

Use cookie authentication in asp.net core

To configure In the Startup.ConfigureServices method, create an authentication middleware service with the AddAuthentication and AddCookie methods: services.AddAuthentication(Microsoft.AspNetCore.Authentication.Cookies.CookieAuthenticationDefaults.AuthenticationScheme) .AddCookie(options => { // ...

Added by marschen on Sun, 01 Dec 2019 16:07:32 +0200