Dot.Net Developer
UnRuled Developing with Microsoft .Net Technologies.
In .Net Core 3, If you set session and when you try to get session value back,if you get null value, please make you added the following in Startup.cs file
services.AddSession(); and app.UseSession();
and also make sure to add the following code
services.Configure(options =>
{
options.CheckConsentNeeded = context => false;
options.MinimumSameSitePolicy = SameSiteMode.None;
});
Best of luck😎
(In .NET Core 3.0) In Dubbing mode in Visual Studio, If you tried to edit Html or Css and tried to refresh page, and the page content not updating, then here is the solution
Install the Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation
NuGet package.
and then
services.AddMvc().AddRazorRuntimeCompilation(); (in startup.cs)
this will solves the problem and once you saved edited .cshtml, and refresh the page in dubbing mode, changes will reflect in b😀rowser. Cheers... Happy coding
In .Net Core 3.0 ASP.NET MVC, do not use Async in method name (ex : LoginAsync)
Full Example:
public ActionResult LoginAsync(NewModel model)
There will be simple 404 Page Not found error.
Reason : Not Known.
In .net core you can add AutoValidateAntiforgeryTokenAttribute in Startup.cs file, So there is no need to add controller or action attribute ([ValidateAntiForgeryToken]) (dependency injection)
So add this to Startup.cs
services.AddMvc(options => options.Filters.Add(new AutoValidateAntiforgeryTokenAttribute()))
and then add below to view page .cshtml
AntiForgeryToken()
and in ajax call something like this
$.ajax({
type: "POST",
url: '.Action("actionName", "ControllerName")',
beforeSend: function (request) {
request.setRequestHeader("RequestVerificationToken", $("[name='__RequestVerificationToken']").val());
},
data: data,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) { }.....
http://dynamicprogrammingworld.blogspot.in/2017/11/in-c-double-question-mark-operator-in-c.html
?? in C# (double question mark operator in C#) Or null coalescing operator null coalescing operator The operator "??", yes two question marks. called as "null-coalescing" or just the double question mark op...
Error : Visual Studio, Process with an ID ???? is not running
http://dynamicprogrammingworld.blogspot.in/2017/07/process-with-id-is-not-running-in.html
Process with an ID ???? is not running in visual studio 2015 Possible Solution 1: Close VS. Navigate to the folder of the solution and delete the hidden .vs folder. Restart VS. Hit F5 and I...
09/05/2017
https://www.codeproject.com/Articles/850062/Exception-handling-in-ASP-NET-MVC-methods-explaine
Exception handling in ASP.NET MVC (6 methods explained) - CodeProject In this article we have discuss 6 ways of handling exceptions in ASP.NET MVC.; Author: Shivprasad koirala; Updated: 5 Dec 2014; Section: ASP.NET; Chapter: Web Development; Updated: 5 Dec 2014
15/04/2017
How to send Email using ASP.Net Mvc
https://www.mikesdotnetting.com/article/268/how-to-send-email-in-asp-net-mvc
27/02/2017
C # 7 New Features
https://www.kenneth-truyers.net/2016/01/20/new-features-in-c-sharp-7/
22/02/2017
https://weblogs.asp.net/jongalloway/using-node-js-in-an-asp-net-mvc-application-with-iisnode
24/10/2016
http://www.dotnetcurry.com/csharp/1291/json-linq-using-json-net
Querying JSON using LINQ | DotNetCurry JSON.NET is a great framework for working with JSON data. We will perform JSON Serialization and Deserialization operations and query data using LINQ.
Click here to claim your Sponsored Listing.
Category
Contact the business
Website
Address
Naas Road
Dublin
22
27/02/2017