180 questions
0
votes
1
answer
67
views
ASP.NET Core MVC : view with Angular 19 component disappearing URL
I am using the Angular 19 Full Calendar component. I have a dedicated Angular Workspace I use to develop the Angular component, I am using
ng build --configuration development to deploy the component ...
0
votes
1
answer
212
views
[FromBody]. Param value in Post Controller is always NULL
I am new to .net web apps. My usecase is make a post call with XML as body. I am trying to make a call through postman, but the param value received in my controller is always null. Below are the ...
0
votes
1
answer
571
views
AJAX POST giving 404 or 415 in .NETCore 2.1 with referenced Razor Class Library
I have a .NETCore 2.1 web application and a separate Razor Class library.
The RCL contains some common partial views and functions which I intend to use in separate projects.
I am trying to make an ...
0
votes
1
answer
4k
views
InvalidOperationException: Unable to resolve service for type '*Models.LandingPageContext' while attempting to activate Controller'
I have a database named "LandingPage", and using this command i have mapped the database tables inside my asp.net mvc core:-
Scaffold-DbContext "Server=(localdb)\ProjectsV13;Database=LandingPage;...
1
vote
1
answer
731
views
Getting single bunch of multiple empty values of textbox in jquery
I want to get multiple textbox values from a table inside a object I have five textboxes
From the code below if I have entered value inside only one textbox, I am getting only two values, not five ...
0
votes
1
answer
2k
views
Pass parameters to HttpPost method of controller
There something very basic i must be missing which i cant understand what it is.
I have a method at the controller
[Route("SomeMethod")]
[HttpPost]
public IActionResult SomeMethod([...
4
votes
4
answers
3k
views
Controller post [FromBody] Null issue when when migrating from .netcore 2.2 to 3.0
I had a completely functioning program at version 2.2
when migrating to version 3.0 and replacing
public void ConfigureServices(IServiceCollection services)
{
...
services.AddMvc();
}
With ...
0
votes
1
answer
93
views
Cannot generate a new controller via scoffolding in Entity/C#
I am taking a tutorial on getting started with Entity Framework and C#.
I was following the [tutorial][1] and I am getting an error when I tried to create a new scaffolding item. When I select the ...
2
votes
1
answer
2k
views
How to change page size in Grid.mvc
I have the following controller:
public ActionResult Grid()
{
schoolEntities db = new schoolEntities();
List<Student> result = db.Students.ToList();
/...
0
votes
0
answers
1k
views
How can i remove blank between rows in fast report table for browsers?
I am using Fastreport for mvc core project but i have a problem for created table in fastreport. My created table includes some blank between rows or column but there is no problem exporting the ...
0
votes
2
answers
42
views
how to fix linking pages with on another in same website
I've created a default mvc web application in visual studio 2017. the issue i'm facing is when i run this application it shows me the main interface and after it when i click the contact us page in ...
0
votes
1
answer
1k
views
ASP.NET MVC: Trying to pass a variable to another Action/Method
I am from Classic ASP background. I am just trying to declare a variable int TOTAL_ROWS at the top and after I know how many rows in my MySQL database at the bottom, I will assign it to the variable ...
4
votes
0
answers
1k
views
ASP.NET Core Nested / Tiered Controllers
Hi there fellow Overflowing Stackers! Looking for your help in regards to having tiered or nested controllers in asp.net core
So far from what I can see, the default boilerplate code, and its default ...
1
vote
2
answers
598
views
mvc controller pameter getting null value in ajax call
I am making ajax call like this
deleteAge(item: any): string {
$.ajax({
method: "POST",
url: 'DeleteAge',
data: item.Id(),
...
1
vote
2
answers
1k
views
ASP.NET CORE 2.2 call to web api targeting .net framework does not get called
I have a solution with contains a class library targeting the .Net framework 4.7 and another project with ASP.NET Core 2.2 .
The class library targeting the .Net framework contains controllers as ...
2
votes
1
answer
1k
views
MVC - unable to pass value back to controller using hidden field
I'm trying to assign value to the hidden field in java script using the
JavaScript variable and trying to pass it back to the controller. The value every time I go in the post method for my model ...
0
votes
1
answer
1k
views
How to set `data` attribute of Ajax request dynamically in javascript
I have javascript function that will be called from a few pages when Kendo.Button() is clicked.
This is a Kendo.Button():
@(Html.Kendo().Button()
.Name("btnSubmit")
...
1
vote
1
answer
4k
views
SignalR: Unable to call Hub method from Controller
Environment:
Visual Studio 2017 Community with latest updates
Target Framework: .NET Core 2.1 (latest version)
SignalR Core
Running on IIS Express on Windows 10 (dev environment)
TL;DR: Injecting ...
0
votes
1
answer
1k
views
How to use an optional, generic parameter on a controller action?
I am working with a BaseController that is used for a variety of entities. They may have int or string primary keys, represented by <TPk>.
E.g.:
[HttpGet]
public ActionResult Create(TPk id)
{...
0
votes
1
answer
139
views
ASP.NET MVC Core Tag Helper Issue
I am having an issue using tag helpers in a form element. When I choose the "GET" HTTP method, the parameter for my Edit method in my Item controller won't get filled by the "hello" argument. However, ...
0
votes
2
answers
2k
views
GetExternalLoginInfoAsync return null value
I am working on MVC core 2 and IdentityServer4, External user logged in successfully, the problem i'm facing is this function always return null in HomeController.
var info = await _signInManager....
1
vote
1
answer
3k
views
Cannot get a response from a Web API call
I have the following in the TreeController controller in a small web API:
[HttpGet("GetDirectories")]
public IActionResult GetDirectories()
{
var baseDir = _config["QuickShare:...
0
votes
1
answer
260
views
Setting a response code in a MVC5 ApiController that returns json
I have something like this using MVC5:
Namespace Controllers
Public Class WorkflowsController Inherits ApiController
<HttpPost>
<ActionName("SaveComment")>
Public Function ...
0
votes
0
answers
28
views
Decimal that starts with 0 causes a 404 when looking for it's controller
Sorry guys I know there must be a simple solution for this but I cannot find it. We are passing a variable called 'amount' (decimal) to a controller. If the amount is 1.00 or over the controller works ...
0
votes
1
answer
161
views
Configuring my route in Asp.Net MVC
I'm trying to configure my route so that it reflects the tab the user is on within the page. Pics below.
If the state is on 'Upcoming' I want to just have a route with the state = Upcoming like this ...
0
votes
1
answer
89
views
ASP.NET MVC looking for wrong action(without parametrs)
I want to create an edits views, all for one big model in table, but there will be smaller models" for Basic Informations, Contact Informations etc, my model Table is really big and I don't want to ...
0
votes
2
answers
4k
views
Return HttpStatusCode.BadRequest from Initialize method
I want to return BadRequest status code from Initialize method. I understand, how can I do it from any Action ( return new HttpStatusCodeResult(HttpStatusCode.BadRequest) ), but how to do it from ...
0
votes
1
answer
460
views
use RenderMvcController to filter a list in Umbraco
my goal is to create a list of contents (of specific docType) . in this list I have a filter button and two ddlist dynamically filled with children data. when user click the "filter" , the list should ...
0
votes
0
answers
279
views
User domain in Windows authentification in ASP.NET MVC 5
I want to authorize access to my Web ASP.NET MVC application only by users in MyDOMAIN (MyDOMAIN\MyUSER), and other users who don't belong to this DOMAIN can not authenticate. How to proceed?
0
votes
2
answers
2k
views
How to create a controller in VS 2017 Core
I installed RTM VS 2017 and created a project:
Template: ASP.NET Core Web Application (.Net Core)
ASP.NET Core 1.1 Templates:Web Application
Right Click Controller, Add, Controller and select Full ...
1
vote
1
answer
125
views
MVC 4 Displaying error message
I have a requirement where an action link with query string parameter has been implemented from a controller view say CreateFilter which navigates to a different controller say Create where I parse ...
1
vote
1
answer
2k
views
Search for a file content in c#
Hi I'm writing a c# code where in there is a string sent as a parameter input to the method. And then the inputString has to be searched in the file and the result has to be returned. Currently I know ...
1
vote
0
answers
83
views
Is it possible to parse complex types out of the box in the controller?
I couldn't find much about this in the documentation, all of the examples has primitive types in their input, like int id.
I did find an example though of someone passing a Date, and i was thinking ...
0
votes
1
answer
537
views
How do I call a database 'select' stored procedure with parameters, from a MVC Controller?
I currently have a controller which populates a partial view with all rows from a database view.
public ActionResult SearchResults()
{
return PartialView("~/Views/TransactionHistory/...
0
votes
0
answers
136
views
MVC Controller gets NULL Exception
I am using ASP.NET Core and AngularJS (not AngularJS 2). I followed this link AngularJS Tutorial for Login with MVC but my mvc controller (AuthenticateUser) gets null value. Though I am getting this ...
6
votes
5
answers
16k
views
Routing not working when sending a DELETE request to an HttpDelete action
I have a ProductsController with only one View - Index.cshtml.
The following 3 action methods are inside of this controller:
//http://localhost:55555/products
[HttpGet]
public IActionResult Index(...
0
votes
1
answer
1k
views
@Html.Action and Controllers with same name
While creating a Plugin for a MVC site, I'm facing an issue about controller resolution.
Here are all the routes that concern the current context :
routes.MapRoute("Route1",
"Admin/Product/{...
0
votes
1
answer
2k
views
MVC.NET Core / Razor: Submit value from Select box to DB
The form is defined in Add.cshtml:
@using bendinsnMusicApp.Models
@model Album
<h2>Add Album</h2>
<form action="Add" method="post">
Title: <input type="text" name="Title" ...
1
vote
1
answer
81
views
MVC Entity separation best practise [closed]
This is a hypothetical question, lets say i have a very basic forum
I have the following entities (objects)
public class User
{
public Guid Id { get; set;}
public string Username { get; set;...
0
votes
0
answers
60
views
MVC Project does not accept controller name (MemberController)
My MVC in my project "MemberController" will not accept the name.
What could be the problem.
0
votes
0
answers
117
views
How to call a WebApi from within of a controller Using the DependencyResolver
I need to call a WebApi method from a controller:
I can call the webApi method, but I keep on to get the following exception message:
"Value cannot be null.
Parameter name: request"
when I reach the ...
0
votes
1
answer
195
views
Getting scrambled code instead of error page on .NET 4.5
Whenever a error is thrown during the loading cycle (page load, map request ...) of any of my .Net 4.5 components (controller, webforms ...) I got the following scrambled code:
Any exception leads to ...
0
votes
1
answer
84
views
Find Controllers which aren't in use
Fairly new to this and as you cann tell learning - but basically my manager has thrown me in the deep end and I need a little help to swim - He wants me to create a list of all the controllers which ...
14
votes
3
answers
19k
views
How to get the database context in a controller
I am trying all day to figure out to get the ApplicationDbContext in the ManageController.cs of a default MVC 6 project.
I went online and Googled a lot but no one seems to have the same problem as I ...
1
vote
1
answer
1k
views
how can get root page url in OnActionExecuting method while executing ajax request in asp.net mvc
I am executing a page where Page contain multiple Tabs and each tab call ajax method to get it's own view.
My problem is when ajax request come on controller then OnActionExecuting method I am not ...
0
votes
2
answers
154
views
MVC after finishing a job in controller 1 go to controller 2 [duplicate]
I have following scenario: I have a web application, with this web application I can create a simple document. I have also two Controllers: the default HomeController and another DocGenController. I ...
2
votes
2
answers
838
views
ASP.NET MVC Controller causing page reload when uploading a Blob
When I send a Blob to a controller via ajax, saving the file in the controller causes a page refresh. If I don't save the file, it doesn't refresh. My code:
Update I spun up a new blank ASP.NET MVC 5 ...
1
vote
1
answer
45
views
MVC Controller unit tests writing
I have a question related to unit tests. I have MVC controller in which i have different actions and i want to write unit tests on all actions.I have written unit tests on classes/functions using ...
0
votes
1
answer
967
views
Search view : MVC
I need to make a "Search and filter view"
My problem:
I want to create a Search view where the user selects by which attribute he wants to search and than enters something in textbox and submits it. ...
0
votes
0
answers
52
views
Error Encountering in Creating New Controller in ASP Web API
I'm having a problem in creating my new controller inside the "Controllers" folder provided by ASP.Net MVC API. I don't know how can I fix this thing. I already rebuild all solutions. But when I ...