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
votes2
answers818
viewsBlock click the menu item after the first click
I’m having a hard time blocking simultaneous clicks on menu items in my application, when the user first clicks I want to block attempts at new clicks, I want to do this because there is a user…
-
1
votes1
answer127
viewsHow to delete data Modal Bootstrap on the second time - ASP.NET MVC 5
When I open Modal the second time, the audio element remains the same. I already uploaded new audio and still continues the old audio. Please follow my code below. <div class="col-xs-6">…
-
1
votes2
answers1873
viewsHow to check if the query did not return data?
I have a query and would like to know if the same returned data. //classe aplicação- private List<tb_cabecalho> TransformaReaderEmListaObjetos(SqlDataReader reader) { var retornando = new…
-
1
votes1
answer244
viewsForeach without repeating the name
I have a Foreach in View, and it contains Description, Qtd and dta,how do I make a foreach without repeating the description? Ex: I have a product X whose were removed 10 units day 01/10/2016, 3…
-
1
votes1
answer706
viewsFill Dropdown from the selection of another Dropdown
Guys, I’m trying to fill one DropDown from the selection of another DropDown, basically, when the user selects a state in a DropDown, cities of this state must be displayed in another DropDown,…
-
1
votes1
answer27
viewsHow do I get the name that’s in Resources for the field names?
When I have an application using Resources, and on my screen I have a text for example: <section> <div id="banner"> <h1> Com você, aonde você for! <small> dicas sempre…
asp.net-mvcasked 8 years, 1 month ago Harry 3,805 -
1
votes1
answer973
viewsList of View objects for controller
I have two Customer and Address entity where the customer has multiple addresses. At the time of completing the form, the user can add two addresses in the same form and at the time of Submit, I…
-
1
votes3
answers860
viewsIs it possible to call the same method in all Controller Asp.. net mvc without having to repeat the code?
In my Controller Home, I have this: /// <summary> /// Aqui estou trocando o idioma da página de acordo cam a seleção do /// usuário. /// </summary> /// public ActionResult…
-
1
votes1
answer1071
viewsInjection of Depension with Ninject C#
I am developing an application that has 4 layers Dominio, Infra, Servico e Web When I have access to a route for example Home/Index he says that there is no constructor without parameters, my…
-
1
votes1
answer189
viewsCall Partial with Ienumerable within a page that has its Ienumerable Asp.net mvc?
In my layout I have an option where I show some notifications, to include in the layout a partial : @Html.Partial("_PartialNotificacoes") @model IEnumerable<Generico.Dominio.TB_NOTIFICACAO>…
-
1
votes0
answers82
viewsList a restaurant, from the item that is saved in the database, within a table Cart
I would like to list a Restaurant, where items from this same restaurant have been saved inside the cart. When saving the product of the cart, it pulls with it the ID of the restaurant. Follow my…
-
1
votes2
answers881
viewsFormat data dd/mm/yyyy in a jquery Datatable.net
How I format that date 2016-10-23T20:30:01.017 in one Datatable.net in the Brazilian format dd/mm/yyyy ? Controller: This relevant snippet of the code is where I populate the object that is in the…
-
1
votes1
answer410
viewsUsing the Reportview
I’d like some help. I’m using the ReportView to generate a report from id passed as parameter: public ActionResult Relatorio(Guid id) { LocalReport relatorio = new LocalReport(); //Caminho onde o…
-
1
votes0
answers58
viewsFormatting Date Time
I have a field in the Datahora database, my class is simple and has no Annotation public DateTime DataHora { get; set; } i have these two fields on the screen for the user who will use a single…
-
1
votes1
answer345
viewsError (Connected String) Asp . Net MVC - Visual Studio 2013 and SQL Server 2012
I have a problem with my MVC Asp.Net. I created the Connection String inside Webconfig, <connectionStrings> <add name="connSql" providerName="System.Data.SqlClient" connectionString="Data…
asp.net-mvc web-application exception visual-studio-2013 connectionstringasked 8 years ago Marcelo Medeiros dos Santos 73 -
1
votes1
answer286
viewsRetrieve the value of a dynamically generated field
Good morning. Staff would like to know how do I recover the value of the control that is generated dynamically in my form at runtime? Type below in the image I have a class that brings all the…
-
1
votes1
answer882
viewsHow do I get the view id if I have Asp.net mvc?
I have the following situation, in my _Layout I am checking: @{ var controller = HttpContext.Current.Request.RequestContext.RouteData.Values["Controller"].ToString(); var view =…
-
1
votes1
answer496
viewsSending form to Pagseguro
I have this form @using (Html.BeginForm("PacoteAdd", "Pacote")) { <input type="hidden" name="email_cobranca" value="*****@hotmail.com" /> <input type="hidden" name="tipo" value="CBR" />…
-
1
votes1
answer233
viewsAsp.net HTTP Client get with query string
Developed on an Asp.net mvc I intend to implement an HTTP request that with this part of code the meteorologies present me a "list" with the parameters of the query…
-
1
votes1
answer59
viewsSearch information in the database in one SQL code line per logged in user
I have already been able to search all the dates of the database. However, I would like to search through a specific ID that is logged in to the system. Per session, in case. But this code is giving…
-
1
votes1
answer59
viewsFluent API modeling with reference table
I would like to know how I perform the modeling of a given entity, where its reference value belongs to another table. This benchmark would be a domain table that has your credit card id s, because…
-
1
votes0
answers73
viewsSyntax problem or bug?
I’m using onclick to run a Javascript when a button is clicked on the dropdown-menu. The problem is in view: Full code of the above image: /*Linha 1*/ <div id="context-menu4"> /*Linha 2*/…
asp.net-mvcasked 8 years ago Matheus Miranda 5,375 -
1
votes3
answers179
viewsSelect the Controller name via Javascript
I have the code below and would like to add to class="current" to <li></li> according to the controller I am accessing. I want to do this to make the item stand out. <ul…
-
1
votes1
answer50
viewsError loading CREATE page
I have two related methods. Patrimonio and Categoria: [Table("Patrimonios")] public class Patrimonio { [Key] public Guid PatrimonioId { get; set; } public Guid CategoriaId { get; set; } [Required]…
-
1
votes1
answer88
viewsRequest performance using Html.Beginform versus jQuery AJAX
There is some performance gain when using jQuery to perform ajax requests relative to the post using Html.Beginform? @using (Html.BeginForm("Create", "Teste") { @Html.AntiForgeryToken()…
-
1
votes1
answer723
viewsGet Return of Procedure on Oracle
I need to run a database (Oracle) that returns me a character (S or N), I’m using the ODP.NET driver, I tried everything and could not do it, including I looked at several answers right here in S.O…
-
1
votes3
answers712
viewsCompare string to Enum, inside the lambda?
the problem is: I have a dropdownlist loaded from an Enum, which can come with the null value of the screen. listaItensSolicitados = os.Site == null ? this.itemSolicitadoService.Consultar(o =>…
-
1
votes1
answer301
viewsHow to work with anonymous guy
I have the following code snippet: var filter = new { categoria = 1, cond2 = foo, ... }; p = new ProdutoBusiness().listarProdutos( filter ).ToList(); I wanted to work with this anonymous type as a…
-
1
votes2
answers2589
viewsCannot implicity Convert type 'System.Collections.Generic.Ienumerable' to 'System.Collections.Generic.List'
I have the following method below for the purpose of returning notifications that must be displayed to a particular customer and notifications that must be displayed to all customers. public…
-
1
votes1
answer67
viewsHow to load a Partialview to create a comment
I am working on a project to learn ASP.NET MVC and Razor. Right now I have a model of post with a view, and a view associated with model class comment to create a new comment. I wanted to know how…
-
1
votes1
answer593
viewsPagedlist: Data Pagination with Ajax
I’m using Pagedlist with Ajax, but I can’t change the page because when I click on the button, which represents the page, the value that is going to the controller is null. I made the following…
-
1
votes1
answer3116
viewsERROR Security.Securityexception - HOST Locaweb
Hello, I need help with the error below: My HOST is Locaweb, and I’m trying to run my ASP.NET MVC application but it gives error of Security.SecurityException. All the references I found indicate to…
-
1
votes1
answer134
viewsAutocomplete with typeahead and JSON
I have an ASP.NET MVC project and in it a script for autocomplete using typeahead with Prefetch: $(document).ready(function () { // Sonstructs the suggestion engine var ativos = new Bloodhound({…
-
1
votes1
answer68
viewsError when registering user
When I try to create a second user, with ASP.NET MVC, presents me with a mistake: Violation of PRIMARY KEY Constraint 'Pk_dbo.Aspnetusers'. Cannot Insert Duplicate key in Object 'dbo.Aspnetusers'.…
-
1
votes1
answer54
viewsDisplayname does not work in relationship
have a model: public class TalaoCode : ITalaoCode { [Key] public int TalaoCodeId { get; set; } [DisplayName("Equipe")] public int EquipeId { get; set; } [DisplayName("Equipe")] public virtual Equipe…
-
1
votes1
answer99
viewsDoubt with Enablecors Asp.net web.api
When is the release of an address made using the Enablecors can be used the Route or is it necessary to change something? is correct this way? [HttpGet] [Route("consulta/BuscaTipoPagamento")]…
-
1
votes2
answers26
viewsHide in an Actionlink, is it possible?
I’d like to depending on my condition ActionLink was visible or not. Razor: <td> @Html.ActionLink("Cadastrar site","MontarFancyCadastrarSite", "ItemOS", new {ChaveOS = Model.ChaveOS }, new {…
-
1
votes1
answer63
viewsOpen Search Description (press tab to search)
I made a system of extensions for the company and wanted to implement in this system the "press guide(tab) to search" that I see on various sites. I’ve done it every way I can, and I can’t bring…
-
1
votes1
answer97
viewsMVC 5 Ajax.Actionlink returns result, but does not render in DOM
Gentlemen, I’m having trouble displaying a list of results in my view. The idea is, by clicking on a dropdown value, I make an asynchronous query to popular the next dropdown. I refer to the…
-
1
votes1
answer56
viewsInsert data with related objects
I’m trying to insert an object containing a relationship. User > Enterprise First I need to get the data from User in View of Create I’m doing it this way: public ActionResult Create() { var…
-
1
votes1
answer1393
viewscall action method in the controller via a view script
I have an action inside my controller, to download an XML file, with the following signature. public Actionresult Export(int id){}, no understand on my page I have a button that calls a download…
-
1
votes1
answer83
viewsASP.NET MVC with Angularjs and Layoutpage
I am developing an application using the best of both worlds of Asp.net MVC and Angularjs. I do the database requests with Webapi which works very well. But now I have added an angular module in the…
-
1
votes1
answer144
viewsHow to convert data to string from JSON? (Javascript MVC C#)
The data looks like this: Date(-4735141200000) for me: function (dados) { console.log(dados); var len = dados.length; var txt = ""; var toDate; if (len > 0) { for (var i = 0; i < len; i++) {…
-
1
votes3
answers519
viewsSending temporary information between classes with C# 4.0 MVC 4
Working with a Solution VS 2015 that has 2 sites, "projectA.site.com.br" and "projectB.site.com.br", their views and controllers are in the same project, named as "WEB", developed in C# . NET 4 with…
-
1
votes1
answer837
viewsHow to return output varchar from a precedent in c#?
Error that appears: An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code Additional information: Error converting data type varchar…
-
1
votes2
answers174
viewsWebgrid with Radiobutton
I want to select a line from Webgrid through a Radiobutton and by clicking the button Visualise, carry a partial view with the information of the selected line. How do I pass the information from…
-
1
votes1
answer416
viewsHow to insert arrays inside angular objects?
Let’s say I have a vehicle object that has the following attributes converting my class c# to Json: { "UsuarioId": 0, "TipoId": 0, "MarcaId": 0, "ModeloId": 0, "VersaoId": 0, "Quilometragem": 0,…
-
1
votes1
answer139
viewsSend External Login Data to Controller
I need to login through Facebook, I have the login page, which renders a @Html.Partial _Loginexternal Follow the code of both: @using EuVotoAf.Models @model LoginViewModel @{ ViewBag.Title = "Log…
-
1
votes1
answer1742
viewsHow to open file with window.open in a post?
My controller returns two file types: pdf and excel. return File(stream, "application/pdf"); return File(new MemoryStream(ep.GetAsByteArray()),…
-
1
votes1
answer678
viewsValidation for Textarea using Razor MVC 4
I have the following modal and need to include validations so that the textarea is mandatory when clicking the "Yes" button, that is, it cannot be sent in white, and so that the textarea has at…