Passing Data from Controller Action Method to Razor Page in ASP.NET Core MVC

We can pass the Data from Controller to View in 2 ways. 1. ViewData Example for Single value data Action Controller Code: In controller write below code to save value in ViewData. To show it in the Razor page, we can write @ViewData[“Key”] Index.cshtml View : In your cshtml to show data in front end write below line of code To save data in list … Continue reading Passing Data from Controller Action Method to Razor Page in ASP.NET Core MVC

Passing Data from Controller Action Method to View in ASP.NET Core

We can pass the Data from Controller to View in 2 ways. 1. ViewData Example for Single value data Action Controller Code To show it in the View, we can write @ViewData[“Key”] View Code Controller Action Code Then, in View we need to set the value of ViewData[“ListItems”] as the collection of integer list. View Code 2. ViewBag  ViewBag is easier and simple way. It … Continue reading Passing Data from Controller Action Method to View in ASP.NET Core

Build Your Own Cortana Skill

Building a Cortana skill means that Cortana can use your bots, services, websites, and apps to help people – but did you know that you can write the whole skill with C# and .NET? During this session, we’ll learn about Cortana and the Skills Kit, build a skill step-by-step, and discuss how you can work with Cortana to build personalized, intelligent experiences for your users. … Continue reading Build Your Own Cortana Skill

What’s New in Visual Studio 2017

Visual Studio is a productivity game changer for C#! The .NET Compiler Platform (“Roslyn”) enables many new experiences that will change the way you write and debug code. In this session, we’ll dig into features that bring a new level of awesome to the C# language and IDE experience. Come learn about new language features, refactoring support, major debugging enhancements, code-aware frameworks, and much more! … Continue reading What’s New in Visual Studio 2017

What’s New in Entity Framework Core 2.0

Entity Framework Core is a lightweight, extensible, and cross-platform version of the popular Entity Framework data access technology. In this session we’ll look at what’s new in EF Core 2.0 and what the team has planned for upcoming releases. Video: https://channel9.msdn.com/Events/dotnetConf/2017/T221/player   Continue reading What’s New in Entity Framework Core 2.0

How to set and get the session value in asp.net core.

Originally posted on Rijwan Ansari:
The Microsoft.AspNetCore.Session package provides middleware for managing session state. Add the following heightened line in your Startup.cs public void ConfigureServices(IServiceCollection services) { services.AddMvc(); // Adds a default in-memory implementation of IDistributedCache services.AddDistributedMemoryCache(); services.AddSession(options => { // Set a time for session options.IdleTimeout = TimeSpan.FromSeconds(200); options.Cookie.HttpOnly = true; }); } public void Configure(IApplicationBuilder app) { app.UseSession(); app.UseMvcWithDefaultRoute(); } Following line of… Continue reading How to set and get the session value in asp.net core.

How to Restore the deleted/quarantined items by Windows Defender?

Originally posted on Rijwan Ansari:
Sometimes Windows Defender can detect your custom app, .exe file or other files as a threat and might have been deleted by the defender. If you want to restore it back here are some steps to follow. Steps: Open the Windows Defender, you can directly open by typing Windows Defender Security Center in the search. 2. After opening, Click on Virus… Continue reading How to Restore the deleted/quarantined items by Windows Defender?

How to get the session value and show into view in asp.net Core?

One way for this is:  Get the session value and store it to View Bag in the controller and then show the view bag value to the View. There are mainly two steps. In Controller, Firstly get the value of session to the view bag by writing these code 2. In the View, write following line to the appropriate division where you want to show the … Continue reading How to get the session value and show into view in asp.net Core?

Searchable Dropdown in SharePoint /ASP.NET

Originally posted on Rijwan Ansari's Blog:
As we know that default dropdown list is not searchable. Simple way to create searchable in asp.net/SharePoint solution. Problem: Resolution: ( Converting simple dropdown list to searchable ) Add following CSS link in the page: <link href=”Content/choosen/docsupport/style.css” rel=”stylesheet” /> <link href=”Content/choosen/docsupport/prism.css” rel=”stylesheet” /> <link href=”Content/choosen/chosen.css” rel=”stylesheet” /> Add Following script link in page: http://Scripts/jquery-1.10.2.js http://Content/choosen/chosen.jquery.min.js <script… Continue reading Searchable Dropdown in SharePoint /ASP.NET