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
9 views

ModelState.AddModelError is setup to display Canned message instead of real Error

In my website i had a group of people working on my site and i have this code that they put a canned message in for an error. When i debug the code it is actually a different error but displays this ...
0
votes
0answers
4 views

mvc background create excel file without save server

I have a problem abouth my view is frozing waithing my exportexcel function result this function is void type and ım call thıs fucntion with parameters in my action view problem is some times ...
-2
votes
0answers
8 views

How to Change PSD Color with asp.net C# [closed]

I'm trying to extract the layer From PSD file And Change its Color to different Color and save it to jpg
0
votes
0answers
29 views

'An item with the same key has already been added'

I am trying to send some data to the database via this form. I keep getting the error about an item with the same key has already been added. I have been trying to debug this error for quite some ...
0
votes
0answers
11 views

Bind IEnumerable property of class to kendo mvc grid column

Let's imagine that we have a sample class looking like this: public class ExampleDto { public IEnumerable<PersonDto> Persons {get; set;} public string Title {get; set;} } View model ...
-1
votes
0answers
17 views

Alternatives and advice on a “Helper/Utility” class which only includes static methods

I have a question regarding good practices/principles when it comes to Helper/Utility classes in OOP. I have read online that helper/utility classes are a bad practice and go against what OOP is ...
0
votes
0answers
4 views

how to handle session management per web request with asp.net mvc 4 and nhibernate 5

I am returning to nhibernate after many years away and I am upgrading a codebase to nhibernate 5.2.6. What are the best practices for session management in an ASP.NET MVC app. I used to use castle ...
0
votes
1answer
20 views

If I use async task in an action definition, should that action be async related?

Say I have public class MyController : Controller { ... public async Task<IActionResult> MyAction() { DoSomethingSync(); return View(); } Is it well used? Shouldn't ...
0
votes
1answer
44 views

Calling Repository Pattern methods returns null in Asp.Net Mvc Core

Hello i am using in an Asp.net MVC CORE project a repository pattern adapted from here. while i am using the GetAll() method to make a call to the database works if i try to use T GetSingle(object ...
0
votes
1answer
16 views

Getting error in Asp.net core when implementing TodoList service

I'm following on some tutorial which creates TodoList and uses multiple layer structure to handle different business logic. When I copy code from the book it shows me an error when I fire dotnet run ...
1
vote
1answer
31 views

How do you setup an ASP.Net 3.0 Core Web API project to use AutoFac and NLog?

I know that this question is requesting how to use two libraries, integrated into one .Net project, but after a lot of searching and article reading, I can't find anything specifically useful. ...
0
votes
1answer
15 views

Put two ajax helpers text boxes next to eachother

How do I put 2 input text boxes next to each other that share the same search button with AJAX forums? When I try to do it it ignores the second text box input. One input is searching an event by ...
0
votes
1answer
32 views

Allowed Values of field in ASP.NET

Is there any data annotation for the allowed values in ASP.NET MVC Core? Since there is no enum in SQL server I am not able to migrate my class with enum field in it to the database. I want to give ...
0
votes
0answers
47 views

Why does SqlConnection Object get Closed in return values from Web Api

In the Winforms Application I have this: private void butErrorTesting_Click(object sender, EventArgs e) { HttpClientHandler handler = new HttpClientHandler(); ...
0
votes
1answer
18 views

BuildBunderMinifier in .Net Core Auto Build

I am building C#/MVC web apps, and have used BundleConfig.cs in past C# MVC .Net Framework projects, using the RegisterBundles library to minify CSS and JavaScript files. While developing/debugging, ...
1
vote
0answers
28 views

ASP.NET MVC5 routing/rendering slow

I am facing a rendering/routing performance issue with the following scenario: There's 2x2 Windows Server 2012 machines (2 machines in a testing environment, 2 in production). The web app runs fine ...
1
vote
1answer
19 views

servicestack auth is failing with 502

I upgraded to servicestack from 5.4.1 to 5.6.0 and now my service in azure is locking up and will not allow users to login. If I restart the service it works util some point they receive an error. ...
-2
votes
0answers
24 views

fullCalendar in javascript [closed]

I am trying to fetch JSON array which is more than 10000 length and try to fit into fullCalendar. But I am not seeing anything in the calendar. This is the code : $('.calendar').fullCalendar('...
0
votes
0answers
18 views

ASP.NET MVC is not deployed completely

Good morning everyone! My question is probably super simple. Let me start from the beginning. I created a ASP.NET MVC ,web app. Then, I added a model and controller. Apply migration and updated ...
1
vote
1answer
46 views

Issue deleting ASP.NET Identity in MVC Web Application

So after looking around for guides and tutorials of how can I delete ASP Users, I found the following code to be pretty neat: [HttpPost] [ValidateAntiForgeryToken] public async Task<...
0
votes
0answers
19 views

How to solve 'Cannot authenticate using Kerberos' issue doing EF Core database scaffolding in Linux(Ubuntu 18.04)? Are there any solutions?

everyone. I've been trying to develop simple starting AspNetCore application with EntityFrameworkCore to connect and work with MS SQL server database. And manage all this by Rider IDE, tool for ...
1
vote
3answers
69 views

DATEDIFF how to write in Asp.net MVC

I am creating a car retail system. I need to the display if I enter the correct carid relevant car information will be displayed in the below text boxes. I have attached the screen shot image below. I ...
2
votes
1answer
27 views

How to change SignalR maximum message size?

I need to transfer large JSON messages in SignalR, but the maximum message size is limited by default, is there any way to increase that maximum size? I have also find some relevant links but didn't ...
0
votes
0answers
28 views

ASP.Net MVC choose DropDownList/TextBox for editing depending on which one is visible

I have following code in my cshtml for creating a new database entry: @using (Html.BeginForm()) { <script type="text/javascript"> function ShowHideAds(button) { var dAds = document....
0
votes
0answers
13 views

“There is no ViewData item of type 'IEnumerable' that has the key” Problem

I need to set "ManagerID" as the "id" from "Employee".(I mean ManagerID and id are linked). I write codes but have a problem. It shows items with dropdownlist correctly but when I try to apply, it ...
-2
votes
0answers
23 views

Best way to clear the session [closed]

Which is the best way to kill the session: by using session.Clear(), session.Abandon(), session.RemoveAll() or session.Remove("variable")?
0
votes
1answer
47 views

Javascript joining table cells ASP.NET MVC

We're working on a website which has a page that displays a schedule with different schedule items in them, all these items have certain values attributed to them and they're all original/unique. The ...
0
votes
1answer
42 views

The ViewData item that has the key 'KategoriId' is of type 'System.Int32' but must be of type 'IEnumerable<SelectListItem>'.'

Product registration in ViewBag gives the following error during selection in MVC registration process. The ViewData item that has the key 'KategoriId' is of type 'System.Int32' but must be of type ...
2
votes
1answer
44 views

Download zip file from webapp

The user of my webapp should be able to download a zip-file with more than 10MB. I have the following code in my controller: [HttpPost] public IActionResult Download(){ Response.Clear(); ...
0
votes
0answers
18 views

How do I properly implement Stripe to my ASP.NET MVC application

So far I've managed to setup the Stripe library to the point where I can create test subscriptions but I'm still facing a few issues. For instance, if it returns incomplete in my controller over at ...
0
votes
0answers
9 views

MVC lifecycle, opening a page in an iframe: UrlReferrer is null and trying to use a whitelist in OnResultExecuting()

A client has asked to open our pages in an iframe on their page. We have set up a whitelist which includes the remote site's address, and it's partially working. The filter is set up in ...
0
votes
1answer
27 views

Result not displayed if i enter the carno on textbox Asp.net MVC

i am creating a car retail system. i need to the display if i enter the correct carid relavent car information will be diplayed the below textboxs. i attached the screen shot image below. i need to ...
0
votes
1answer
49 views

How to save multiple values into one text file in ASP.NET MVC

I need to save multiple values from multiple text boxes into one text file. I'm able to save only the firstName but not the Surname. Any suggestion on how to save the both surname and the first name ...
0
votes
2answers
37 views

how to post complex array to mvc c# api

I'm trying to post an array tat one of it's members (th) is an array of strings, I stringify the array, here is hob it looks stringified: [{"id":"201669887","name":"אורה","Sunday":"1","Monday":"1","...
0
votes
0answers
23 views

I can't connect my ASP .NET app from Docker-container to my computer host database with “host.docker.internal:some-port”

I lost amount of time trying to connect my app container with my database Azure Cosmos DB Emulator. I am using loggers object to know where my app break, and I found that the problem is in the ...
0
votes
0answers
44 views

An error occurred while starting the application .NET Core 4.6.27617.04 X86 v4.0.0.0

I have created an ASP.NET Core MVC web application and use SQL Server 2008 as backend, and also fetch record from database use for NHibernate framework, but when I run the application the following ...
0
votes
1answer
26 views

How can I log output of all Rest Api(ApiController) methods?

I have developed a REST API web service using APIController in C#. They will return values like this: [System.Web.Http.HttpGet] public IHttpActionResult Index() { var maxReqLen = ...
0
votes
1answer
29 views

Trying to install microsoft.aspnet.web.optimization in ASP.NET MVC project getting error

I am trying to install microsoft.aspnet.web.optimization in an ASP.NET MVC project, but I'm getting this error: Install-Package: An error occurred while retrieving package metadata for 'Dapper.1.60....
0
votes
0answers
14 views

Why am I now unable to publish to SmartASP through FTP or file system?

It worked before but now I get this error after publishing my MVC Core website though VS2017 Publish Wizard. An error occurred while starting the application. .NET Core 4.6.27617.05 X86 v4.0.0.0 | ...
0
votes
1answer
62 views

How to validate that only one CheckBoxFor equals to “true” of a group

How can I enforce to select only one option of the checkboxes being equal to "true" of a group? It can be with jQuery or Data Annotations... Because currently you can submit with all being false, and ...
0
votes
2answers
26 views

Send List items using JQuery Post to ASP.NET Controller

I have the following JQuery code in my .cshtml file. $.ajax({ type: "POST", url: urlPath, dataType: 'json', contentType: 'application/...
-1
votes
0answers
13 views

How can I make a quantity piker in razor view

I need the user to tell me how many products he needs, them I need to upload it to my database with a button i have this in my table.
0
votes
0answers
18 views

Opinion on which technology to use (Angular 8 with WebApi or MVC (.net Core) [closed]

This is purely opinion based but just want opinions and thought process or experiences. If creating a new application which technology would you use and why? The 2 technologies I am thinking of is ...
1
vote
0answers
66 views

Is it possible to “debug” an application on the server?

I am working on an ASP .Net Core C # application. In Visual Studio 2019, I do some debugging, of course. On localhost, my system is functioning normally, but on the server only the static pages. My ...
-2
votes
0answers
17 views

Angular with ASP.NET MVC [closed]

I have few questions on implementing Angular with ASP.NET MVC/CORE: I want to learn angular and implement it into ASP.NET MVC application. Can I start from Angular 8? What what are the prerequisites ...
0
votes
1answer
33 views

Join multiple tables with Select and Where clause by Lamda expression

I have 3 table like below Table 1: Brand +-------+---------+-------+ |Code(k)| Name | Sale | *Code - set Primary Key +-------+---------+-------+ | AP | Apple | False | +-------+--------...
0
votes
2answers
40 views

Remove Duplicate/Similar Data from Model

I am attempting to remove duplicate data from a model This is a scorecard. There can be multiple users on a single scorecard. Session ID represents a SINGLE scorecard. I would like to group the ...
-1
votes
0answers
38 views

How to create label and Textbox dynamically with click the button corresponding to each row of the table in MVC project?

I have a view in my MVC project with URL .../Crisis/Index.The following image: I have 2 table in sql that have relationship together. Crisis and CrisisResource. each Crisis record has multiple ...
0
votes
0answers
11 views

Add loader on Post Call in MVC .net

On post call add loader while server side execution in progress after server side execution completed remove loader. I try for ajax call It working fine but I need same for Post call. $body = $("...
0
votes
0answers
12 views

What Web TWAIN scanning solutions for ASP.Net are there [closed]

I am looking at implementing a web scanner to scan files and upload them to the server into my asp.net application. I am looking for options that that aren't very expensive such as Scanner.Js cost ...