Dot.Net Developer

Dot.Net Developer

Share

UnRuled Developing with Microsoft .Net Technologies.

11/10/2019

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😎

07/10/2019

(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

26/09/2019

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.

25/09/2019

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) { }.....

10/11/2017

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...

14/07/2017

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...

Exception handling in ASP.NET MVC (6 methods explained) - CodeProject 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

Querying JSON using LINQ | DotNetCurry 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.

Want your business to be the top-listed Computer & Electronics Service in Dublin?
Click here to claim your Sponsored Listing.

Address


Naas Road
Dublin
22