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
1
vote
0answers
11 views

Model not taking all properties value from the View(new added Property only)

this my model `public class Patients { [Key] public int PatientId { get; set; } [Required] public int HospitalId { get; set; } public Hospital Hospital { get; set; } [...
0
votes
2answers
13 views

MVC ASP.net ajax json Datatables errors - json error, cells not displaying data

this may be a duplicate but I've tried everything I can find on stack exchange and datatables.net forums. I can't get it to work at all. I have var listOfFiles which is a list of the following model ...
0
votes
0answers
7 views

How to Open Multiple Modals Bootstrap Cascading Windows

I have an ASP.NET MVC project in which I open each of the views in a modal window dynamically. Just created a modal block id = "modalGenerica" ​​and open any view of my project inside it. All this ...
-3
votes
2answers
31 views

How to do a switch statement using a url and Contains()

I have some urls that look like this: /Collection/Summary?ViewBy=AZ I'm trying to implement a switch statement so that if the url contains X, then Y will happen. This was working when it was just an ...
-1
votes
0answers
24 views

How to Change color of a mage [closed]

I have to change this first Image color to any other color. First Image URL https://drive.google.com/open?id=0B1mKL-VmTQKLb0VyUU1Hb0hfVDd2aU5JSXAwWkJ1YzhmbnFB Second Image URL https://drive.google....
0
votes
1answer
26 views

jQuery Javascript Modal Popup not working in MVC

when I click on link "Comments" a modal popup opens up and shows content, therefore it does what it is supposed to. Going to my issue: In the first scenario, it happens what I want but some other ...
0
votes
1answer
12 views

Hosting a mvc net core in root and the staging version in a subdirectory using nginx

The idea is to serve a production mvc net core app in website root and the staging version in a subdirectory: https://my.website.com (Production) https://my.website.com/pre (Staging) Currently the ...
-1
votes
1answer
21 views

How can I update database table using signalR?

I am working with sigbalR for the first time and following a tutorial on automatically updating a table in the UI. Unffortunately nothing is fired on the UI when I add/update/delete a row in the ...
0
votes
0answers
9 views

Set Virtual Path to ASP NET Core MVC Application behind nginx reverse proxy

I have an ASP NET Core application running inside a docker container and I'm trying to access this application using a NGINX Reverse Proxy that I built inside another docker container. When I try to ...
1
vote
1answer
27 views

I added a column to an existing table in the database then after refreshing Entity Framework, data table (js) stopped working (server 500 error)

There is no relationship between the column I added to the table and the table attached to the datatable. I checked all the models files there are no differences. There are no warnings or errors. All ...
0
votes
1answer
15 views

Are there lifecycle hooks in ASP.NET MVC?

I am new to ASP.NET MVC, but have experience with other MVC frameworks - mostly CakePHP. Is there anything resembling a lifecycle event system in ASP.NET MVC? I'd like to be able to plug into ...
1
vote
0answers
13 views

Why isn't the .AspNet.ApplicationCookie Secure / SameSite set to Strict by default?

Why doesn't the identity cookie (.AspNet.ApplicationCookie) set by asp.net mvc framework which authenticates the user set to have SameSite to strict or Secure set to true by default? Doesn't this make ...
0
votes
2answers
40 views

ASP.NET web api returning only first object in each object in a array

startup.cs services.AddMvc().AddJsonOptions(options => { options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; }).SetCompatibilityVersion(...
-1
votes
0answers
14 views

Cron expression to skip public holidays of the year [duplicate]

I've a ASP.Net MVC application, We are using calender control to pick the date on UI. We are using cron expression to set the public holiday date. My requirement is Date picker on UI should not allow ...
0
votes
0answers
25 views

Asp.net (MVC) authentication cookie lost on redirect — but only on Firefox

Scratching my head on this one. I set an authentication cookie and then do a redirect and everything works fine EXCEPT for Firefox. I can see the cookie get added but then removed once the redirect is ...
0
votes
3answers
35 views

How to pass to RedirectToAction a parameter to another Action?

When the user completes the survey and sends a query to the database, he should return the same view but each time with different results, depending on the options selected. From the user's side: I ...
0
votes
1answer
29 views

Fill in Textboxes with Address Info, when Dropdownlist item is selected .NET Core

I have read a ton of articles and none of them have been much help for in the context I am trying to do this. I have a Dropdownlist within an Edit User Modal, for Companies. When I select an item ...
0
votes
4answers
47 views

ASP.NET MVC & C# : pass a viewmodel to controller

I have a controller that passes the viewmodel to a view, and in the view it creates the table correctly. Then in the same page of the table I have a link that redirects the user to another page. ...
0
votes
1answer
29 views

Cron expression to skip only public holidays of the year

I've a ASP.Net MVC application, We are using calender control to pick the date on UI. We are using cron expression to set the public holiday date. My requirement is Date picker on UI should not allow ...
0
votes
0answers
8 views

Jquery email validation is not working in MVC

I'm using this code in mvc for email validation but after we typed @ of any text in textbox for example : [email protected] after @ validation is not wokring and form is submit without validation error. if (!...
0
votes
0answers
7 views

Anonymous on the entire site except for one page using asp.net

I would like to have anonymous access for an entire asp.net site except for one page. On that one page, I would still like everyone to access the page but I would like to retrieve their username. ...
-1
votes
0answers
7 views

uncomment [ValidateAntiForgeryToken] possible solution [closed]

If I bound partial view in main view, and edit the partial view and click submit, the modelstate said invalid. As I commented [ValidateAntiForgeryToken] it works fine.I want to know is there any ...
1
vote
0answers
30 views

ASP.NET Core 2.2 How to override UserManager.CreateAsync to remove unique Username requirement

I am trying to override my UserManager.CreateAsync to remove the requirement of a unique Username. How can I do that? So far this is what I have public class CustomUserManager : UserManager<User&...
0
votes
0answers
12 views

How to perform a login identification process in the best way?

I have 2 inputs boxes: Public key (user name) and Private key (password). Also I have a hidden warning label. This is my code (and it's perfectly working ): <script language="javascript"> ...
0
votes
0answers
24 views

Unable to resolve 'Microsoft.AspNetCore.SpaServices.Extensions (>= 3.1.0)' for '.NETCoreApp,Version=v3.1

I recently downloaded the new version of asp.net core sdk (3.1.100) and created a .net core app project. When I wanted to addAspNetCore.SpaServices.Extensions (3.1.0) to my project, I faced these ...
0
votes
1answer
26 views

I want to download XML file in C# which I created using XmlWriter.Create() on user's system

I have a method to create an XML File and save it to the desired file path. It works perfectly. But the problem I am facing is I have to allow the user to download this file but it gets downloaded to ...
0
votes
1answer
11 views

Pdf to Pdf redirect rules not working in web.config

I have tried to redirect the pdf to pdf by the following the rule in web.config <rule name="r_1" stopProcessing="true"> <match url="^/media/peedin5t/xxx.pdf$" ignoreCase="false" /> &...
0
votes
0answers
11 views

MVC server side JQuery DataTable date and numeric data sorting [duplicate]

Hi I am using datatable server side proccessing with datatable.net. when i am sorting date it is sorting as string and start with 31-10-2019, whenever i have a record with date 05-12-2019. same ...
0
votes
0answers
27 views

I'm trying to get file path from another project in same solution but I get error in mvc c#

The error is Sequence contains no matching element static string GetpathJsonlist() { var bundleAssembly = AppDomain.CurrentDomain.GetAssemblies() .First(x => x.FullName....
0
votes
0answers
22 views

AJAX receives 500 Internal server error when calling ASP.NET MVC Controller

I'am receiving a 500 internal server error when trying to call a controller action using Javascript AJAX. I want to call a controller method when the user clicks the confirm button. CS Controller ...
0
votes
0answers
5 views

Blank Space in between two sub report in Telerik Report in asp mvc

How can I solve this issue. I have one master report and two sub report. one sub report which is show the chart and graph and second one is show the list. but the problem is that in two sub report I ...
-1
votes
0answers
16 views

Download file from VB.NET MVC Controller [closed]

I need to receive a file from controller and this works on C#: return File(fullpath, System.Net.Mime.MediaTypeNames.Application.Octet, Path.GetFileName(fullpath)); But in VB.NET i can't make the ...
0
votes
0answers
45 views

<input type=“date”> not working in Safari when i use a layout in asp.net MVC [closed]

I am using HTML5 <input type="date" /> which works fine in Chrome and I get the calendar popup to select the date. But in Safari it acts like a text box and no calendar pops up. After ...
0
votes
1answer
35 views

The type or namespace name 'TEntity' could not be found (are you missing a using directive or an assembly reference?) in .NET CORE And vs 2019

i face this error , when i create IRepository and create Repository inherit of IRepository i have error in it and i declaration IRepository<TEntity> where TEntity : class why this error ...
-1
votes
0answers
38 views

ASP.NET MVC Controller Action return (canceled)

Hello and good day everyone. I am currently having a very strange problem. I am a ASP.NET MVC application that I am currently working on. My problem: In the testing environment (my computer) a ...
-4
votes
0answers
33 views

Is there any C# documentation for integrating SagePay drop checkout? [closed]

I’m fairly new to web dev and have an MVC5 site which I want to to integrate SagePay drop checkout to. I’ve been using this documentation here but the C# section says “coming soon” which isn’t much ...
-1
votes
1answer
44 views

asp.net mvc c# when i am binding data using model site loading is very slow [closed]

I have a website in asp.net-mvc. Website is loading very slow and my domain is this I have checked data bind from sql server is fast but when we bind data to the view using model and iPagedList for ...
-1
votes
0answers
29 views

ASP, System.Web.HttpContextBase cannot be loaded?

I've been trying to run some of ASP.Web.Helper 's charts but every time I try to do anything involving them it doesn't work. I am using ASP2.2 in a Webapp, trying to follow this simple tutorial ( ...
1
vote
1answer
24 views

Converting a complex json format to C# class for Highchart Organization Chart

I'm trying to achieve Highcharts JSON data format for Organization chart (organogram) which indeed an inverted Sankey chart as well for my asp.net MVC project. The series property of the chart mainly ...
0
votes
1answer
20 views

Automate custom code generation when “Run Custom Tool” on tt file

I have this edmx, database first, in project "DAL". But the tt file from edmx is in another project "DomainModel". Both projects are in the same solution. Now, whenever I created new table in ...
0
votes
1answer
24 views

Convert date time format ASP.net MVC @Html.DisplayFor

I would like to ask if how can I convert a date format of like "Dec 05, 2019" to this line? @Html.DisplayFor(Function(modelItem) Now, item.created_d) from auto crud function from mvc controller Thank ...
0
votes
0answers
11 views

Exit IOwinContext conditionally

I have a web application that uses OKTA authentication. I have a startup class that uses OWIN. Everything works currently, if user is not authenticated I am redirected to OKTA authentication page etc. ...
0
votes
0answers
7 views

Getting Oauth onexternallogincallback?error=access_denied on certain Google Accounts and not others

Recently our Google Signin started failing (externallogincallback?error=access_denied) on certain client deployments of our MVC app. The only variable seems to be the Google Account where the Client ...
0
votes
1answer
26 views

HTTP 405 Error on invoking controller method

I have a .NET Core 2.2 web app. I need to get the value of a textbox in a controller method so I have this code: <button type="button" onclick="location.href='@Url.Action("Create", "Home")'" /> ...
0
votes
1answer
23 views

How to Properly Redirect in AspNetCore 3.0 Action Filter Attribute?

I need to redirect to another action for setup if the account setup is not complete. However, when I use this action filter: public sealed class AccountSetupFilter : ActionFilterAttribute { ...
0
votes
1answer
14 views

how to sort models by specific property and show it to view?

i have model class called SCARF and it has ID,title,name,price property the name property is unique for every SCARF but title dont i have plenty SCARf with same title i want to sort SCARF by title ...
1
vote
1answer
38 views

Directory file search multiple images

I'm using: String[] FileNames = Directory.GetFiles(Path, partNumber + ".jpg"); in order to get image files from a directory. The images are named after a partNumber and use an underscore ...
0
votes
1answer
34 views

ASP.NET Core using MVC with Entity Framework - Edit method not showing values

I'm using ASP.NET Core (2.1) with MVC and Entity Framework for my school homework. I'm trying to add Edit for my Models, but actually the fields of the Edit view remains empty. Empty fields I got to ...
0
votes
0answers
18 views

Suppress “Custom error module does not recognize this” error message in IIS

From a MVC controller action, I am setting Response.StatusCode = 429; and returning JsonResult. It's a requirement to send this status code for the action. It works fine locally but on remote server, ...
0
votes
0answers
15 views

How do I pass CheckBox values from a view to a controller using @Html.CheckBox?

I need to display 6 types of tests on my view and allow the user to check as many tests as they'd like to complete. I will then need to send their response to my controller so I can add that ...