Skip to main content

All Questions

2 votes
1 answer
801 views

session being null when redirect to query string url in .net core

I'm setting url with query string when anyone hit such page which is only access after login. I set that controller name as query string and redirect to login page. everything working good till here. ...
Love Pandey's user avatar
2 votes
2 answers
7k views

How do I run/trigger service in startup.cs?

I have a service which grabs the token and save in cache, I added service like below, but it's not running when the app starts what do I need to do to trigger this service on startup public void ...
JKLM's user avatar
  • 1,510
1 vote
0 answers
327 views

Extending ClaimsIdentity?

I'm trying to customize ClaimsIdentity. The reason being that I don't want to use cookies to hold all the claims because in the context of my application, I have many (hundreds) Projects a user could ...
Francis Ducharme's user avatar
0 votes
1 answer
1k views

How to make IMemoryCache available in all controllers?

I have followed this tutorial https://learn.microsoft.com/en-us/aspnet/core/performance/caching/memory?view=aspnetcore-2.2 It is using Dependency Injection to make IMemoryCache available in specific ...
JKLM's user avatar
  • 1,510
1 vote
1 answer
3k views

What is alternative of "TransparentNetworkIPResolution" in ASP.NET CORE

I have used "TransparentNetworkIPResolution" this keyword in ASP.NET MVC in SQL Connection string. My code as below <add name="LocalString" connectionString="Data Source=Server;Initial Catalog=...
jishan siddique's user avatar
0 votes
1 answer
339 views

Linq GroupBy expression raises AnonymousType exception

I have a query that returns an IEnumerable that I use to display a table of values. I would like to group the tables (using a <H3/> element) by the model's DateTime field (StartTime). I ...
craig's user avatar
  • 26.1k
0 votes
0 answers
267 views

ASP.NET Core: [Policy based Authorization] No authenticationScheme was specified, and there was no DefaultChallengeScheme found

I use policy-based authentication to provide access based on menu rights to logged in user. If the menu has access then I call context.Succeed(requirement); but on error (unauthorized menu access), I ...
SanketS's user avatar
  • 973
0 votes
1 answer
53 views

Make JSON deserialiser distinguish between a class and a subclass of that class

In an asp.net core mvc application I'm working on, I use sessions to keep track of a List of instances of a model I made called "Rule". Now, you can't save objects other than strings and integers in ...
Niels Boelens's user avatar
2 votes
1 answer
341 views

MVC Change Landing Page is not working: Options.Conventions.AddPageRoute(

I tried changing the landing page of my web page Mvc application using this command. However it is still redirecting me to regular index, not Products/Index. How would I resolve this? public void ...
AlexRodgers's user avatar
3 votes
1 answer
936 views

Change MVC Home Landing Page: No service for type 'Microsoft.Extensions.DependencyInjection.IServiceCollection' has been registered

I tried changing the landing page of my web page mvc application using this command. I received this error below. How would I resolve it? public void Configure(IServiceCollection services, ...
AlexRodgers's user avatar
0 votes
2 answers
621 views

How to have two different types of users for WebAPI and MVC .netcore 2.0

I'm creating an asp.net core 2.0 app (with EFCore an Identity), which has: website (MVC) where people can register and buy different plans (with different prices etc). So, these users must confirm e-...
martinpessoa's user avatar
1 vote
1 answer
228 views

Url.Action is wrong with Knockout + Asp.Net MVC Core 2.2

I am trying to generate a table containing a link for each row with knockout and Asp.Net Core 2.2. Actually I want the whole row to be clickable later, for this example I added it as a table field ...
Tigerware's user avatar
  • 3,710
0 votes
0 answers
309 views

ASP.NET Core MVC view: Copying View and Repasting Code, Identifier Expected error received

I am trying to create a simple ASP.NET Core MVC app to display files in folder on webpage. I am getting an error Error: identifier expected in first line for view How would I resolve this? It ...
user avatar
1 vote
1 answer
290 views

How to inspect asp.net core methods?

I created a new ASP.NET Core MVC application with individual user accounts authentication. I would like to see how they implemented some methods. I suppose I can do it since ASP.NET Core is open ...
justme's user avatar
  • 336
2 votes
0 answers
2k views

Net Core: 'RouteCollection' does not contain a definition for 'IgnoreRoute'

I am migrating a project from .Net 4.6.2 to .Net Core 2.0. What is the replacement for IgnoreRoute in .Net Core? I'm receiving the error below: Code: public static void RegisterRoutes(...
user avatar

15 30 50 per page
1 2
3
4 5
34