Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [asp.net-mvc]

The ASP.NET MVC Framework is an open source web application framework and tooling that implements a version of the model-view-controller (MVC) pattern tailored towards web applications and built upon an ASP.NET technology foundation.

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

Sporadic: The file '.cshtml' has not been pre-compiled, and cannot be requested

Symptoms: ASP.NET MVC website sporadically crashes and all .cshtml pages requests fail with this error. The problem seems random and happens once or twice a month. The site may run for months with no ...
1
vote
2answers
27 views

how does host differentiate MVC request and Web API request

I'm new to asp.net mvc and web api. I'm reading a book which says: ASP.NET MVC uses: System.Web.HttpRequest and Web API Equivalent is System.Net.Http.HttpRequestMessage and below is a picture that ...
0
votes
0answers
21 views

Issue with routing in MVC route.config

I am having an issue with my routeConfig file. It is my understanding that when it processes it goes through and finds a match and should not care of the order. Correct me if i am wrong. I have a ...
0
votes
0answers
15 views

How To Get Access and Refresh Token Using Google Api Key instead of Google OAuth

I'm getting access token and refresh token for Google Youtube data api using "OAuth", for this i made a call to google API with my credentials and google returned an authorization code and that code ...
0
votes
0answers
16 views

Dispersing results from grid onto multiple pages with MCV

I currently have view with a grid displaying some data ( I would prefer a table but this is what was wanted). The query that returns the data can have the possibility to return 100+ records. I would ...
2
votes
1answer
43 views

How do I pass a value from view to repository in ASP.NET?

I am working on an ASP.NET MVC web portal that requires users to accept Terms of Use when they first log in. After the user clicks to accept, I need to pass back a bool (AcceptedTerms) as true. This ...
0
votes
0answers
10 views

Having trouble including double quotes with RegularExpressionAttribute [duplicate]

Having trouble including double quotes in a group of acceptable characters in a Regular Expression. I have a Asp.Net MVC project with a model that has some string properties that I want to only allow ...
0
votes
1answer
23 views

Passing input value to a controller method, not the whole model in Asp.Net Core 3

I have a ToDo items dashboard page where I display the ToDo's, their status and some other app info. I want to have one input where I can add a string value (the ToDo title) and on the button click ...
0
votes
2answers
47 views

why does returning JsonResult from a Dictionary change the sort order?

I have the following controller action: public JsonResult GetInvestors(int bank) { var investors = _context.Investors .Where(i => i.BankNumber == bank) .Select(i => new { InvestorId ...
0
votes
1answer
17 views

Update ajax url parameter value in jquery

I have a dropdownlist which when selected, needs to update the url, so I could send this updated url via jquery ajax and get the updated result and post it back. The problem i am running into now is I ...
0
votes
1answer
21 views

How to add temporal tables to EF Code-First DBContext?

I want to add SQL temporal tables to my project in DBContext not in migration file? How to achieve it?
0
votes
0answers
18 views

Jquery not disabling dropdown item when requested

I am trying to disable a dropdown item after I select it and click a button. I'm using Jquery and the code looks like this: $("body").on("click", "#AddProduct", function () { var id = $("#...
2
votes
0answers
71 views

How to use a .NET Framework controller from a .NET Core project

We have some old controllers in .NET Framework project (4.5.2) and would like to reference them from a .NET Core application (3.0). Is there a way to do this? Referencing controllers from another ....
0
votes
1answer
27 views

Change identity login URL in ASP.net core 3.0

I'm trying to change the default login URL from: /Identity/Account/Login to /Login I've looked up similar questions and they came up with a solution similar to this: public void ...
0
votes
1answer
29 views

Ajax button not working in asp.net mvc app

I'm making an MVC ASP.NET app in C#, and I need to add a button event in order to do something. So following some tutorial I tried this in the .cshtml file: <button>Next</button> <...
0
votes
0answers
8 views

I need a Rich Text Box

I'm creating an Web Application with ASP.NET MVC for an organization and one of the functionalities is publish short articles. The thing is how I can get a rich text box for create the formatted text ...
0
votes
0answers
26 views

Passing a raw image through ASP.Net Web API

I am having an issue wrapping my head around this one, I have read multiple posts here and I am still utterly confused. What I am needing to do is pass an actual image through a web api I am building ...
0
votes
1answer
38 views

How to get checkbox selected in ASP.NET MVC from database?

I have this model public class UserModel { public List<UserModel> Skills { get; set; } public int SkillId { get; set; } public string SkillName { get; set; } public bool IsSelected{ ...
0
votes
1answer
33 views

Operator '==' cannot be applied to operands of type int and string using Asp.net Mvc

I am creating a simple inventory system in Asp.net MVC I have got an error at this line below int db_product = db.products.First(e => e.id == m.barcode_id);
1
vote
0answers
23 views

Why ASP.NET Core application not loading in iframe in the same domain?

I have an ASP.NET Core MVC website that is the src of an IFRAME inside a portal. Both the portal an the .NETCore application have the same domain (eg. site.portal.domain / portal.domain). When I ...
0
votes
1answer
37 views

Using C# MVC multiple dynamic models in View

I have a View with several form that I'm using for searching and displaying the results as partial View in like SearchByNumber, SearchByVehicle, etc. I'm trying to load view and execute search for ...
-1
votes
1answer
48 views

How do I use DISTINCT inside a MVC view?

I want to list the incoming data once but not work how should I do? public PartialViewResult searchList() { var model = db.search.Distinct().OrderBy(x => x.date).ToList(); ...
-1
votes
1answer
38 views

Display date in local format but force time in 24-hour format

So in one instance I've decorated a nullable DateTime with [DisplayFormat(DataFormatString = "{0:dd/MM/yyyy HH:mm:ss}")] and in another, an interpolated string $"{theDateTimeObject:dd/MM/yyyy HH:mm:...
-1
votes
0answers
17 views

AutoMapper, MapperConfiguration.ctor is slow

We use AutoMapper (version 9) in an MVC5 project where we have around 100 business entities. It turned out that the MapperConfiguration constructor spends about 600ms for execution in our case which ...
-1
votes
0answers
21 views

Invalid expression term '.' when using HttpContext.Current?.Server in razor view

I'm getting a compilation error when using null check ? What would be the possible reasons for this? var serv = HttpContext.Current?.Server;
0
votes
0answers
13 views

Embedded cshtml can't be found in ASP.NET Core MVC 3.0

I have a library in which MVC Razor views are defined. For example \Views\Default\Index.cshtml. And we use this configuration in .csproj to reuse those views across projects: <ItemGroup> &...
0
votes
1answer
21 views

The Best overloaded method has some invalid arguments using Asp.net MVc

i am creating a simple invententy system in Asp.net Mvc i got the Error as The best overloaded method match for 'System.Data.Entity.Dbset.Add(WebApplication27.Models.sale)' has some invalid arguments ...
0
votes
0answers
5 views

Not able to Sigin the Umbraco Website from Identity provider

I've Umbraco website and calling Identity Provider through OpenID Connect when performing login. But after entering credentials (username, password) it throws 'Nonce' value is null. If we use MVC ...
-1
votes
1answer
50 views

Why web api data deserialized from json returned as null and not displayed in view?

I am new to JSON serialization and deserialization, currently trying to deserialize a set of data from a Web API call. The data is visible until the deserialization, but when it's sent to the view, it'...
0
votes
1answer
16 views

MVC Core 3.0 options.LoginPath - add localization route parameter

I have the following code inside Startup - ConfigureServices: services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) .AddCookie(options => { ...
0
votes
0answers
9 views

Connect GitHub or BitBucket to AppHarbor

So I managed to push to BitBucket then created app in AppHarbor but when I "Configure Bitbucket to deploy to AppHarbor" this error occurs: 500 - Internal server error So I tried to Configure GitHub ...
-1
votes
0answers
25 views

Difference between controller.cs and model.cs[MVC] [duplicate]

In mvc application i have EmployeeController.cs and Employee.cs,whats the main difference between them.[i want to know other differences than Controller is inherited from BaseController]
-1
votes
1answer
29 views

How to access Dictionary Model Property value from View - ASP.Net MVC

I want to get value of Dictionary from View. In the view, I have a main/first foreach loop that retrieve data from Model, and inside the main/first loop, I need to retrieve the ListAttribute value ...
0
votes
0answers
19 views

How can i show a pop-up in client side from server side in asp.net MVC

I have a function that does Excel import, while this function is working i want to show a pop-up to client and he decides to continue the function work or stop it. First call of the function is jQuery ...
0
votes
0answers
17 views

multiple select inside dropwdownlist mvc

I need multi select checkbox inside dropdown list mvc <div class="form-group"> <label for="Product" class="required">Product</label> @Html.DropDownList("...
-2
votes
1answer
58 views

Handling Null Fields in MVC + SQL

I have a table that contains certain fields with null values. I have tried handling these errors using the Dbnull but to no avail. The View is displayed but now all fields are blank. Below is a ...
-1
votes
0answers
24 views

The process is not opening the URL when hosting ASP.NET MVC App on IIS, but working on IISExpress

When I run the below code in IISExpress, the code opens the URL in the Chrome browser. But If I host the code in IIS, it doesn't open the URL. I have tried to achieve the goal in a few ways, but no ...
0
votes
0answers
7 views

How to get access token and Id token in Asp.Net (Owin Mvc) Openid Connect

When login performs it will hit the Identity Provider and after entering credentials(username,password) it will redirect to the application. Am following grant types are hybrid, authorization_code ...
0
votes
0answers
8 views

how to use webhooks in quickbooks online to show notification when due date of an invoice is over

I have got this code through intuit developer, but this is not helping me. Maybe I am not able to understand this. Help me! As I am not able to get an idea about how to do it. public class ...
0
votes
1answer
24 views

IIS 10 Windows Server 2019 - 403 - Forbidden: Access is denied when accessing ASP.NET MVC site

Fresh install of Windows Server 2019 and IIS 10 Web Deployed an ASP.NET MVC 5 application to the website Anonymous user identity is set to "Application Pool Identity" Site level also has anonymous ...
0
votes
0answers
13 views

How do I start smartstore.net in Visual Studio localhost?

How do I start smartstore.net in Visual Studio localhost? I downloaded the GitHub code and opened project file from SmartStoreNET-4.x\src\SmartStoreNET.sln now I got Some Errors when I Compile the ...
0
votes
0answers
27 views

Question about updating web.config file after upgrading from asp.net MVC 5.2.4 to 5.2.7

I have an ASP.NET MVC application which I upgraded to use asp.net mvc 5.2.7 from 5.2.4 After the upgrade my package.config file was updated to reflect the change: From : <package id="Microsoft....
0
votes
0answers
9 views

c# ASP.NET MVC Self Update feature

I have a c# ASP.NET MVC Application that is installed in multiple machines. Instead of letting the user to do the update of the site by replacing bin folder, etc.. I would like to implement into the ...
0
votes
1answer
19 views

Error CS0246 The type or namespace name 'ErrorModel' could not be found (are you missing a using directive or an assembly reference?)

Hi I am facing following error while building an MVC core application. Severity Code Description Project Line Suppression State File Error CS0246 The type or namespace name 'ErrorModel' ...
0
votes
1answer
27 views

Cannot compile my webapp due to error in index.d.ts

I walked away from some code three days ago and it was working perfectly. This afternoon, I logged in to see this error: Build:Type '"button" | "view" | "altKey" | "bubbles" | "cancelable" | "...
0
votes
0answers
21 views

How can i convert iterate statement in ibatis to sql

I'm doing c# mvc framework web project and I should convert ibatis query to static query. how can i convert this statement to static sql query? First, I tried to add another procedure which can make ...
1
vote
1answer
16 views

How to lock swagger ui with login screen to only give access to the API end points to only the Authorised users

how do you lock the swagger ui on the asp.net so that only authenticated users gets to see the API end points.
0
votes
1answer
29 views

.net web app runs in VS, but gets 404 in IIS, generates wrong URL

I have a .net 4.6.2 MVC application called Facility that runs fine in Visual Studio, but fails in IIS. On document ready, the browser runs a bunch of functions like this: function ...
0
votes
0answers
39 views

Error : a namespace cannot directly contain mvc

In my Model Folder, in my GuestResponse class. My visual basic project is called PartyInvates1.0. Why is there an error? using System; using System.Collections.Generic; using System.Linq; using ...
-1
votes
0answers
44 views

Convert.ToBase64String without exception

I have working method to convert file (image.jpeg) to byte [] and then put the array into my DB. But the field allows NULL and in this case I have NullArgument exception with converting null to image ...