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
-
-2
votes1
answer147
viewscontroller with the same name (home) in different areas
I have problem of ambiguity, when having controllers, with the same name as, Homecontroller in two areas: Admin and Backoffice is me presenting the problem of ambiguity, I’ve searched enough subject…
-
-2
votes2
answers65
viewsI’m trying to do a research boot on my view, but tell me it can’t be null
I’m trying to make a search button on mine view of films, but gives me a mistake to say that I can’t have a zero value. Why? And what do I have to do? Controller: public ActionResult Index(string…
-
-2
votes1
answer43
viewsQuery that searches quantity of items from a column in a table with the same name
Hello, I’m trying to find the amount of records with the same name, from a certain column in my Lead table in the database in a period (month). Follow my class, I want to search only from the field…
-
-2
votes1
answer39
viewsOrder By Doubt with LINQ to generate report
I’m making a report with the iTextSharp and I order by date but when I view the report the company Empresa2XYZ appears 2 times with the same date. Follow the code with LINQ. lista =…
-
-2
votes1
answer65
viewsFormatting Javascript data
The date is filled in according to the information obtained from a JSON response Script $(document).ready(function () { $("#@(Model.Campo)_Nome").typeahead({ source: function (query, process) {…
-
-2
votes1
answer151
viewsFill inputs as option selection
Hello! I have this View where I update the value and quantity of a product in the Database by selecting it in Viewbag, works perfectly. I populate this Viewbag as follows in Controller:…
-
-2
votes1
answer29
viewsI need to show all day sales MVC C#
Through an input the user enters the date and so list all the respective products of that day public void Buscar(Lancamento lancamento) { string sql = string.Format("SELECT DataHora FROM…
-
-2
votes1
answer30
viewsI need help because I don’t understand why my code isn’t performing date filtering. ASP.NET [Solved]
When I do the filtering, no value is returned to me my view index page I think the problem is in my Actionresult index, but I don’t know what it is, because I think the references are correct. What…
-
-3
votes5
answers2197
viewsHow to create a switch.. case with value ranges?
If a total of days is over 30 and under 60, I do something. If it’s over 60 and under 90 I do something else and so on. How do I do this case? Did the case is the best option?…
-
-3
votes2
answers292
viewsHow does the flow of a Web Service work?
I need to develop a web service, and its main idea is client-server communication. But I do not understand how this would be done using the MVC architecture and using the C#language, will have the…
-
-3
votes1
answer87
viewsProblem with Asp.net MVC routes
I have an application in which I put as a new site and it worked well, but when putting this application inside another, gives an error in the route. I need that when logging in, direct to…
asp.net-mvcasked 9 years, 4 months ago AndreeH 1,333 -
-3
votes2
answers712
viewsSelect separated by semicolon to xls
I have the following code: var cmd = @"SELECT mt.Id + ';' + mt.Nome + ';' + mt.Cidade AS Resultado FROM MinhaTable mt"; var objectContext = ((IObjectContextAdapter)db).ObjectContext; var result =…
-
-3
votes1
answer1168
viewsinsert background image in mvc application
Good morning as I leave a background image in my application that is in mvc, I saw some examples that is in the Content folder but when opening the page does not run in the background, thanks
-
-3
votes1
answer541
viewsGet the return of a Webapi method?
I have the following code is I want to get a return on the result variable if it is true or false, how could I do it? //http://localhost:1608/api/ApiCidade/deletar/cliente/10 [HttpDelete]…
-
-3
votes1
answer284
viewsAlternative to recover ASP NET MVC password
By default the passwords are recovered by sending email. I will be responsible for viewing passwords and delivering them to users if they forget. I cannot use emails to reset because users identify…
asp.net-mvcasked 5 years, 10 months ago DP WS Receptivo 77 -
-3
votes2
answers53
viewsReturn void in an Actionresult method?
I have this method below, and I need to have a condition that depending on it will open a new tab with a url: public ActionResult Index() { //condição return Response.Write(@"<script…
-
-3
votes2
answers547
viewsCreate Bank Automatically with Code First
I am creating an ASP.NET MVC application with Code First. This system is trade management software. I’d like to separate the information from each company, not leave it all in the same bank. We…
-
-3
votes1
answer65
viewsSolution for Getrange error when accessing elements outside the list
By calling the GetRange of a list, where it calls 10 out of 10 values from the list at a time, but the following error: Offset and length Were out of Bounds for the array or Count is Greater than…
-
-3
votes1
answer125
viewsIt is possible to make Dropdownlist "readonly" equal to Textfield
I understand that the DropDownList already is readonly, since I can not change the values of the options, however I need to maintain the uniform behavior of the screen. In query mode I can assign a…
-
-3
votes1
answer426
viewsTake input values in html for object in ASP.NET MVC
I wanted to know how to get the information of the data entered in the html input to create an object by my MVC model and save it in the database. Note: I already have all model classes, interface…
-
-3
votes2
answers122
viewsPass Cpf to a javascript function
My field that carries Cpf is this: <div class="form-group"> @Html.LabelFor(model => model.cpf, htmlAttributes: new { @class = "control-label col-md-2" }) <div class="col-md-10">…
-
-3
votes1
answer100
viewsHow to use a padleft(11) in a get in the API
This is the method I have in my MVC public async Task<List<FuncionarioViewModel>> GetFuncionariosVM() { string url = $"http://localhost:56137/api/GetFuncionario"; var response = await…
-
-3
votes1
answer75
viewsIf no search by value
There is a snippet in my program that looks for a specific string to assign a value to some variable. However I am not able to run these parameters inside the "If"... Debugging goes through this.…
-
-3
votes1
answer64
viewsREAD XML IN ASP.NET CORE
Great, I’m working on a project that consists of reading XML files, but I have a problem. The XML file has several subchilds. <?xml version="1.0" encoding="utf-8" ?> <products>…
-
-3
votes1
answer20
viewsSend more than one checkbox value using Jquery.Multiselect
I was able to send the values of a checkbox to the controller using the function below: function InformacoesAdicionais() { var listOfRegiao = []; $.each($("#select-regiao option:selected"), function…
-
-4
votes1
answer320
viewsDoubt about using a model in the view
I have an entity called Request. I created in the Model folder a class that loads Orders, called Getpedidos. Well, when creating the controller, I added a view to Action Index. When I built the…
-
-4
votes2
answers448
viewshow to send input value to control using querystring Asp.net?
I have this code on View @using (Html.BeginForm("VisualizaJogoParaExclusao", "Relatorios", FormMethod.Post)) { <div class="row"> <div class="span12"> <input class="form-control…
-
-4
votes1
answer202
viewsHow does this class work?
DataSet OleDbConnection OleDbCommand OleDbDataAdapter OleDbDataReader I still can not understand this class in .net. What are these datasets and etc? I’m wearing this: using System; using…
-
-4
votes1
answer82
viewsMap Api port to MVC project
I created an MVC project and an API. I need to get the API when I upload the project to (F5). Example, I created a service that is a GET in my Type table. How I can map the API to get inside a MVC…
-
-4
votes1
answer1594
viewsPut mask to @Html.Editorfor
In the database, the CPF field is bigint and long in the model. I have two problems with this: 1) If Cpf starts with 0 or 00, it will not record this and then, to display on screen, I will have to…
-
-4
votes2
answers115
viewsWhat is a Nullreferenceexception and how do I fix it?
System.Nullreferenceexception Hresult=0x80004003 Message=The object reference was not defined as an instance of an object. Source=App_web_cyyu2ydb Stacktrace: in ASP.…
asp.net-mvcasked 5 years, 6 months ago Manuel Xavier 9 -
-5
votes1
answer473
viewsReturn query with more than 1 parameter in Webapi
I have the code below, how would be the correct route? How can I test the call //http://localhost:1608/api/ApiCidade/consulta/clienteLoginSenha/ [HttpGet] //…
-
-5
votes1
answer51
viewsHow and how best to calculate a net value
These days I’ve come across a problem I can’t solve and I don’t know much where it starts. I have these 4 fields on my system, where, if the user infoma the discount in percentage, the system…
-
-5
votes1
answer33
viewsProblem with CPF validation
@model Projeto1.Models.Cliente @{ ViewBag.Title = "Create"; } <h2>Criar Novo Cliente</h2> @using…
-
-7
votes1
answer166
viewsEdit MVC . NET error
I have an error when I edit my registration, my Physical Model is like PartialView,the following error occurs: Attaching an entity of type 'Projeto.Models.Fisica' failed because another entity of…