Most voted "asp.net-mvc" questions
ASP.NET MVC is an open-source Microsoft framework that implements the Model View Controller architecture standards for web development. Based on ASP.NET, it allows software developers to build web applications following the Model View Controller architecture standards, featuring a variety of features following recent trends.
Learn more…3,385 questions
Sort by count of
-
1
votes1
answer119
viewsInstantiating the database context in the controller
Hello, I have a question related to the Dbcontext instantiation mode in the controller. What is the difference between the two methods below instantiation ? 1. private ApplicationDbContext _db;…
-
1
votes1
answer65
viewsHow to put a form in the _Layout view?
I’m trying to make a website with support for two languages. First test I did was to put this code inside a view common, the index of my control Home. Worked perfectly. When I put the same code in a…
-
1
votes1
answer1559
viewsHow to do a back post (refresh) on MVC
I am new to MVC and am used to web Forms and the events of the controls that cause postback and update the page. I need to do this update on the MVC page after a javascript is triggered. In the code…
-
1
votes1
answer357
viewsWhat is "Asp-fallback" for in ASP.NET MVC, Razor Pages?
I see some files like lines similar to this: <script src="https://ajax.aspnetcdn.com/ajax/jquery/jquery-2.2.0.min.js" asp-fallback-src="~/lib/jquery/dist/jquery.min.js"…
-
1
votes1
answer44
viewsLike the Entity Framework Trackeia objects?
I read several questions of the type, but I find my question very specific: How does the Entity framework "trackeia" the objects? That is, as when loading an object and even without sending the…
-
1
votes1
answer223
viewsDefine model the two-dimensional Array type attribute
There is a way to create an attribute of type array two-dimensional no Model so you can use this attribute to mount a table in View. Example: No model define an attribute of type array…
-
1
votes0
answers29
viewsPerformance - Helpers
I have seen several times programmers adhering to the helper in the view, instead of html. I agree that there are cases where you actually "save characters" using them, but, and with respect to…
-
1
votes1
answer680
viewsHow to return query by a string using Webapi?
I have the following code that gives me an error: The inline Constraint resolver of type 'Defaultinlineconstrainaintresolver' was Unable to resolve the following inline Constraint: 'String'.…
-
1
votes1
answer1013
viewsGenerate ASPNET CORE MVC reports
Is there a solution to generate reports in ASPNET CORE 2.0 MVC applications without needing a reporting server? I did some searching and did not find much on the subject.
-
1
votes1
answer151
viewsHow to open a cshtml local webview in Xamarin Forms
I have a project in Asp net mvc and another in Xamarin Forms, I need to call in my project Xamarin Forms a Webview Local but the page is as cshtml (Asp net)
-
1
votes2
answers1205
views@Html.Actionlink and Url.Action are not taking the route of the controller annotation
I have the following method in control: [Route("video/categoria/{categoria}/{page?}/{sort?}")] public async Task<ActionResult> Index(string categoria, int? page, string sort) { ... } My…
-
1
votes0
answers1006
viewsError reading byte array passed as parameter
That is the mistake: The input is not a valid Base 64 character string, as contains a character that is not base 64, more than two characters from or an illegal character between the characters of…
-
1
votes1
answer122
viewsGood Practices for Moving JSON Object
I have a grid (Kendo ui MVC) today has 35163 lines, and I need to create a button to export the contents of the grid to CSV. I thought I would do something like this, the moment I load the…
-
1
votes2
answers129
viewsRegister an "admin" user when running the c# mvc application
good afternoon, I need some idea for a web system to automatically create a user Admin as soon as I run(open) the application. that is, when running the application with a zeroed database, so that I…
-
1
votes1
answer255
viewsHow to write data in one table for many?
I have a question that still persists after making some searches. Is the following, assuming I have a form, where I register several emails to a single user, how I record these several emails in…
-
1
votes2
answers2016
viewsSending Model to Controller via Ajax
I have a strongly typed View with a small form and a javascript function with ajax: function emitir () { $.ajax({ type: "POST", traditional: true, url: '@Url.Action("EmissaoRapida", "CND")', data: {…
-
1
votes1
answer800
viewsTransparent image and background color
I have the following code: FileStream fs = new FileStream(@"\path\imagem1.png", FileMode.Open, FileAccess.Read); Image image = Image.FromStream(fs); fs.Close(); Bitmap b = new Bitmap(image);…
-
1
votes1
answer1174
viewsProblems loading a Datatable in Page Load with Javascript
I’m a beginner with Javascript and I’m having a problem when the Datatable of my Index is loaded. If I open a section, on my Index, and put the JS code inside it, everything works perfectly. @{…
-
1
votes0
answers41
viewsProblems with ASP MVC5 Responsive HTML
I’m having trouble letting my page responsive, for desktop is getting correct, as shown in the image: However, when testing for mobile, it is as follows (using the tool in google Chrome to emulate…
-
1
votes1
answer80
viewsProblems with Entada mask removal in Partialviews - Asp.Net Core
I’m having trouble with input masks (bootstrap) on all screens. I found the following interesting: All my Views that are returned in the form of "Partialview", the input masks do not work. For…
-
1
votes0
answers42
viewsParameters passed to a web service - Asp . Net MVC
My problem is this, I’m making an app in Xamarin Forms and I have to send two parameters to a web service developed in Asp . Net MVC, in case I would like to know how to send these parameters(two…
-
1
votes1
answer46
viewsSynchronous Xmlhttprequest and Xmlhttprequest.withCredentials
When I load my page appears these 2 messages. Below the encoding of my page. @model SistemaComercial.Models.ItensVenda @{ ViewBag.Title = "Adicionar novo item"; Layout =…
-
1
votes0
answers35
viewsPerform sorting by a given field of a given table
I have the following syntax The instruction below perform sorting by field Lot Number table Lot var lvmLotes = db.Lotes.Tolist(). Where(x => x.DataAbate.Date == Search). Orderby(x =>…
-
1
votes1
answer109
viewsproblem with Dynamic proxies ASP . NET MVC
Could someone explain me a method not to pick up the proxies from the Dbcontext and yes the real objects? Following a case: public ActionResult PegarItem(int anuncio, String remetente, int…
-
1
votes1
answer882
viewsHow to resolve error: The best overloaded method match for
Following the models of that question, when I pass the commands to write the form data to the database, before even copying Visual Studio, points out the following error: "The best overloaded method…
-
1
votes1
answer618
viewsPass two parameters - ASP.NET CORE
I need to pass two parameters to a page, when I’m trying to pass one, I do it this way: <a asp-page="/ContaReceber/Edit" asp-route-id="@item.Id;" class="btn btn-sm…
-
1
votes2
answers88
viewsRename error message
Follows model: [DisplayName("Data:")] [ValueParser("ptdateparser")] [AssertThat("DeadLine > Today()", ErrorMessage = "* Data deverá ser superior a data de hoje")]…
-
1
votes1
answer90
viewsPassing code to cshtml page Asp.net core Razor
As I pass this code that is on a page . Cs to a cshtml page. ApplicationUser user = await UserManager.GetUserAsync(User); This page is the layout, no Model and no DTO. Thank you…
-
1
votes0
answers563
viewsSet Fixed Port for Projected Web API Asp.net Core C#
I would like to know how to set up a standard fixed port for my Web API application on Asp.net core.
c# asp.net-mvc asp.net asp.net-core asp.net-core-web-apiasked 6 years, 3 months ago Nicola Bogar 123 -
1
votes0
answers22
viewsPass interface to Signalr Hub
Is there any way to pass an interface as a parameter in the hub constructor? For some operations, you needed to access repository layer methods through interfaces in the hub. Is there any way to…
-
1
votes1
answer363
viewsHow to add fields dynamically and link them to viewmodel in Asp.Net
I have a 1:N relationship between Person and Contact. In my view, I can list all the contacts of a customer when it is opened. I need to implement the "New Contact" button so that when clicked,…
javascript asp.net-mvc asp.net asp.net-mvc-5 asp.net-coreasked 6 years, 2 months ago Master JR 1,853 -
1
votes1
answer94
viewsString in expression Entity C#
I need to make a dynamic query similar to the example below String tabela = "NomeTabela"; Var x = db.("NomeTabela").ToList(); Something like this where the table name will change according to the…
-
1
votes1
answer70
viewsValue and ID at Dropdown Waterfall
Reference that can help you understand the code. Dropdown Cascata This part here I pass the values that will be added in the second Dropdown var classesList =…
-
1
votes1
answer194
viewsif condition with required Viewmodel
I wonder if it is possible to use an if for required in a Viewmodel. For example I have these two variables: [Required(ErrorMessage = "O campo {0} é obrigatorio.")] [Display(Name = "Insc.…
asp.net-mvcasked 6 years, 2 months ago Mariana 2,512 -
1
votes3
answers237
viewsDoubt with pagination in Asp.net
Does anyone know how to implement a pagination or would have an example using this architecture https://github.com/cleytonferrari/PadraoDeRepositorio/tree/master/TISelvagem I would like to use the…
-
1
votes1
answer88
viewsScroll inside a javascript table
I have this Function that mounts a grid in js function CarregarGrid() { $('#gridConteudo').jqGrid({ colModel: [{ width: 80, name: 'COD_OPERADORA', index: 'COD_OPERADORA', label: 'Operadora',…
-
1
votes1
answer319
viewsPost null no Edit MVC
Hey, I got this situation, man Edit returns a group of Classes filled for editing. In my View the data is filled correctly, however, when I edit a field and have it saved in the Edit (Post) my Model…
-
1
votes2
answers61
viewsVariable keeps zeroed in a mathematical expression
My little show is like this: public void CalculaProporção() { decimal contagemSubida = 0 , contagemDescida = 0; int cSubida = 6, cDescida = 4, range = 10; contagemSubida +=…
-
1
votes1
answer76
viewsASP.Net - Javascript file compression / Text Gzip
Good afternoon, I’m having a hard time configuring traffic compression using the GZip. Below are the steps I have already taken to effect compression: I’ve already enabled windows features related…
-
1
votes0
answers23
viewsProblem with ui-router in Angularjs
I’m in Trouble when I’m trying to make a GET on the API to get information. The problem is that the webserver is not Calling the API. I must Fill in the ng -model field named. The following part of…
-
1
votes1
answer58
viewsQuery and view in dropdownlist
Is giving the error below in dropdowList and do not understand why. Error: Cannot associate the 'System.Collections.Generic.List1[<>f__AnonymousType82[System.Int32,System. Stri ng]]' to type…
-
1
votes1
answer584
viewsHow to delete multiple selected records in a Datatable Bootstrap using Javascript - Asp.net
In my Index I have a Table (Datatable Bootstrap) that allows me to select as many Rows as desired. The datatable lines are loaded dynamically using JS. Each Line stores the Registry Id:…
-
1
votes0
answers30
viewsWindows authentication
My Windows authentication is getting lost with time. I do the following validation: if(HttpContext.Current.User.Identity.IsAuthenticated == true) dsHostName =…
-
1
votes1
answer50
viewsCRUD Needs the Procedure
My question is this:. When we create an ASP.NET MVC application that requires a basic CRUD. It is indispensable to use a database with procedures. Or I can do it another way ?…
-
1
votes1
answer86
viewsTimestamp in C# for persistence in Sqlserver
Is there any typing that already treats this in C# to perform persistence in Sqlserver database? I need to resolve the Createdat and Updatedat property. For each change, it will be stored in the…
-
1
votes2
answers320
views@Html.Dropdownlistfor Default item at first list values
Good afternoon, gentlemen. I use DropDownListFor To load lists, example load all my clients to be selected. However, I need that if a record does not appear in the listing have the option to add a…
-
1
votes2
answers69
viewsGlobalization does not work when deploying
I deployed an ASP.NET application on a machine located in the center of the United States and now it behaves as being American even with the instruction below in the web.config file:…
-
1
votes1
answer233
viewsQuantity limit in database query
public IList<DtoContrato> ConsulteListaPorListaDeIds(List<Guid> listaIds) { return Conversor(Persistencia().Where(x => listaIds.Contains(x.Id))); } My question is, if the list of ids…
-
1
votes1
answer414
viewsForm validation ASP.net mvc!
I have a form that validates the fields when trying to send information, only I have a "novapagina" option where I would not like to validate the fields, this would be possible? In the views <div…
-
1
votes1
answer19
viewsDB table not accessible
I have an associative class (Fluxousuario) between User and Flow, where Fluxousuario contains permissions of users for Flow, to know who can access a certain flow, I must go to this associative.…