Most voted "asp.net-mvc-4" questions
ASP.NET MVC 4 is the fourth version of the Model-View-Controller ASP.NET platform for web applications.
Learn more…135 questions
Sort by count of
-
3
votes3
answers1650
viewsSend All Checkbox via Post
I’m trying to send all my View Checkbox, however, I can send only those selected via Formcollection Controller public ActionResult Index() { List<ListaCheckBox> listacheck = new…
-
2
votes2
answers1323
viewsCreate and Edit Onetomany with Viewmodel
I am creating a simple news application in ASP.NET MVC 4. I have a News class and a Category. I made a Viewmodel public class NoticiaCategoriaVM { public Noticia Noticia { get; set; } public…
-
2
votes2
answers217
viewsForm in view with subforms in partialView
Dear friends, I have a view containing only @model Projeto.Models.Oc and a form. Within this form, I have buttons that call MODAL, those MODAL possess partialView who owns another form and @model…
-
2
votes4
answers2258
viewsConditional Data Annotation MVC4
I researched pacas here and did not find a solution for what I wanted. I wonder if anyone has done something similar in MVC4. Model: public class Trabalhador { [Required(ErrorMessage = "*")] public…
-
2
votes2
answers1040
viewsNull check returns reference error
Model public class Transacao { [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)] public int ID { get; set; } [Required] public DateTime Data { get; set; } [Required] public decimal…
-
2
votes1
answer89
viewsRemove part of the time interval Kendo Timepicker
When using TimePicker of KendoUI to define a selection of service hours, the minimum period (8:00) and maximum period (18:00) was defined, but it will be necessary to remove the interval from 12:00…
-
2
votes1
answer735
viewsRegularexpression only letters in the Model
Using the following Regularexpression in the Model: [RegularExpression(@"^\d+$")] public int ano_da_configuracao { get; set; } I get the following result: I tried as follows to accept only letters:…
-
2
votes1
answer478
viewsConditional Sub-model Validation MVC 4 C#
I have the following problem (I will simplify the classes to facilitate understanding): public class Class1 { [Required] public int? Id_Estabelecimento { get; set; } public string Nm_Nome { get;…
-
2
votes2
answers775
viewsProblems with Web.Config
I am having difficulty using several web.config on my system. In my web.config main i have the following configuration: <configuration> <appSettings> <add key="BASE_URL" value="/mvc/"…
-
2
votes2
answers265
viewsConditional Client-Side (Jquery) validation
Late! I am performing a complex validation on a specific class with the following code (reduced to simplify): public class Classe1 : IValidatableObject { [Key] public int Id_Classe1 { get; set; }…
-
2
votes0
answers64
viewsUsing Moq with MVC Dotnet
I am using MVC4 with Moq and would like to know how to mock mine Model also and if this is possible. Thank you.
-
2
votes1
answer164
viewsproblem with jQuery ajax
I am facing a problem when using google Charts, where it is working perfectly in Internet Explorer, but when running the same page in google Chrome or firefox, graphics are not shown my action…
jquery asp.net-mvc asp.net-mvc-4 google-chartsasked 9 years, 4 months ago Pablo Tondolo de Vargas 5,444 -
2
votes2
answers3063
viewsPass values from a form to a method in the Model and return the result to another textbox in the Form
I have a very simple form with 3 textbox and a button. I would like to take the value of the first two textbox by clicking the button and passing to a method present in my model and after that…
-
2
votes1
answer89
viewsIn a MVC 4 C# Web Application model, in which layer can the ADO.NET Entity Data Model file be located?
What layer do I put him in? Model control or view? ADO.NET Entity Data Model what makes the connection to the database.
-
2
votes4
answers492
viewsOrable DB and MVC 4 - Connection error (ORA-06413)
I have a dll which is responsible for carrying out the consultations in the bank. Therein dll, in the connection class, I have a method that opens the connection to the bank and returns the…
-
2
votes1
answer407
viewsSolution . Net with Membership does not connect to oracle base
I am trying to run a project on my computer but it accuses error in string: Oracleconnection.Connectionstring is invalid The same project works normally on the computer where it was started. The…
-
2
votes1
answer127
viewsHow to pass a JSON Object to a method in the webservice?
I’m trying to pass a JSON Object to a method in my controller and I’m not getting it, the problem is that the email field always returns null. How to do this ? I’m trying like this. JSON Object…
-
2
votes0
answers492
viewsUnable to start program 'C: Program Files (x86) IIS Express iisexpress.exe'
My visual studio from night to day started to give an error when starting the application, this error only happens the first time I start the application (Asp.net mvc 4), in other times iis starts…
-
2
votes2
answers434
viewsInput Submit does not call Actionresult
I’m having trouble calling Actionresult using input type="submit" and pass the model data. I did a test using ActionLink but Model is not sent. Someone could shed a light? Here is the code:…
-
1
votes1
answer352
viewsProblem generating list in Viewmodel
I’m working on ASP.Net with MVC 4, and when doing a search/use filters I will present a list of resulting data. To better manipulate this result I created a ViewModel where I put information from…
-
1
votes2
answers3428
viewsTake the value of an input type=text and play in a variable
I am using ASP.Net-mvc4] in my C# project in Visual Studio and I need to get the value of input type=text that’s in my view, and play in a variable on my controller, but I couldn’t find a way to do…
-
1
votes1
answer671
viewsKendo UI Grid Export Excel
I have the following Grid in *.cshtml: $.ajax({ url: '@Url.Action("RetornaJsonGrid", "PacoteLicencas")', type: "post", cache: false }).success(function (json) { $("#gridPacoteLicencas").kendoGrid({…
-
1
votes3
answers542
viewsReceive a Model per parameter in a function
I’m trying to get one Model in a function, which is a step view (although I don’t know if it’s possible) to then generate a list and generate a PDF. My View: @model…
-
1
votes2
answers6021
viewsButton/link inside a view redirecting to another view
I have the following address for a view: http://localhost/Configuracao/Details/1 Where create a button/link that redirects to another address from another view as follows: <a…
-
1
votes0
answers90
viewsASP.NET Menu sitemap does not work after changing version of the framework
There was the need to exchange a server application, however, the new server works with the IIS 7.0 and the application that was developed in .NET 3.5 has been changed to . NET4.0. When the…
-
1
votes2
answers785
viewsInitialize object in Asp.Net MVC
I have a class Cidade who owns the property Estado of the kind Estado: public class Cidade { [Key] public int ID { get; set; } [Required(ErrorMessage = "Campo Nome é obrigatório!")] public String…
-
1
votes1
answer94
viewsHow to format mvc helpers according to my Bootstrap layout?
I am trying in various ways to adjust the layout according to the Helpers <!-- rightpanel3 --> <div data-role="panel" id="opcoesusuario" data-position="right" data-display="overlay"…
-
1
votes1
answer177
viewsPublish ASP.Net website
I did my first "website" test on ASP.Net and when I publish it to my normal ftp (I’m using visual studio 2013) I open the domain http://aizensecurity.freevar.com/ gets all these folders and stuff...…
-
1
votes1
answer97
viewsENTITY FRAMEWORK - add-Migration New Project without renaming old tables
I want to share a database with some projects. I’ve already done the first project with the bank and it’s okay. I copied the project to create another similar one, changed the initial prefix of the…
c# asp.net-mvc entity-framework entity-framework-6 asp.net-mvc-4asked 8 years, 10 months ago Daniel Gregatto 1,054 -
1
votes1
answer164
viewsError while performing connection test in Visual Studio
I’m new to ASP.NET programming, and I’m trying to connect Visual Studio 2013 Express with SQL serves 2012 Express and I’m not getting any results. I did the following procedures; procedure 1.…
-
1
votes0
answers333
viewsList with repeated records via Linq
I am trying to perform a simple query with LINQ, and the code below is returning me repeated records in the first 5 lines of the list. var teste = (from p in db.VW_PAGAMENTO_RECEBIDO where…
-
1
votes1
answer86
viewsHow to set up an Authentication and Authorization Server?
How to set up an authentication and authorization server like Google, by Cookie, and then be able to make available to ASP.NET MVC applications of the same group of web applications with the same…
-
1
votes0
answers330
viewsDisplay jquery datatables search element in a specific div
How do I display, inside a div specifies the jquery datatables search box? My HTML table looks like this: <div class="row-fluid"> <div class="span4 pull-left"> <h4>Gerenciamento de…
-
1
votes1
answer344
viewsHierarchical Object Filter
I have an Asp.net MVC 4.5 C# Razor screen typed by a main class: public class ClassePaiDTO { public virtual ICollection<Filho1DTO> Filho1s { get; set; } public virtual…
-
1
votes1
answer595
viewsRecover property of Object Anonymous C# Razor
I am working with MVC4 and Restsharp for data access via API Rest, My return is an object of the type Object but I cannot recover a specific property of this object. How can I access the property?…
-
1
votes0
answers35
viewsFill Dropdowlist with data from another screen
I have a time zone screen where I have the fields name of the time zone, utc and daylight time only, it works fine. only that I have to create another "time zone period" screen with three fields the…
-
1
votes2
answers231
viewsEF 6 Code First: Decimal field gives error when trying to save
You guys, good morning. I have a class that has a decimal field where I keep the price. So far so good. When it is displayed in the /Edit/ page, also ta beauty. But here’s the problem: 1 - The MVC…
c# asp.net-mvc entity-framework asp.net-mvc-4 code-firstasked 9 years, 6 months ago Luiz Felipe 456 -
1
votes1
answer336
views@Html.Dropdownlist returns null value
ASP.NET MVC4 I’m having a data return problem of a dropdownlist where the same list correctly values, but when choosing some value and post on the page the value arrives as null in the controller.…
-
1
votes2
answers117
viewsError publishing site Asp.net mvc 4
When posting the site on iis 7.5, this error occurs when trying to open the site: Multiple types Were found that match the controller named 'Home'. This can happen if the route that services this…
-
1
votes1
answer1018
viewsError "Access-Control-Allow-Origin header is present on the requested Resource"
I need to insert an API on my site that brings the weather forecast for a certain city, however, the request ajax always returns the error in the browser console. Below: XMLHttpRequest cannot load…
-
1
votes1
answer141
viewsrecover data from a view table in the controller
I have a table that is generated in the View dynamically. From the moment the user selects the products in another table, I need to recover in controller all the ids and quantities of products that…
-
1
votes1
answer409
viewsASP.NET MVC: Automapper and Nhibernate
Good night, I have a problem. I am using nhibernate to connect to my database and also use Automapper to map my Entities to my Viewmodel. But when I select the entity I have several relationships…
-
1
votes2
answers193
viewsDropdownlistfor has no selected value
Dropdownlistfor shows no selected value. public static List<SelectListItem> getMesesPagamento() { List<SelectListItem> listMeses = new List<SelectListItem>(); for (byte i = 1; i…
-
1
votes2
answers456
viewscol-Md-6 is not working on MVC
I created a form using bootstrap.css on w3schools.com/bootstrap/tryit.Asp with the following code: <div class="container"> <form role="form"> <fieldset> <div class="row">…
-
1
votes1
answer256
viewsJquery datepicker blank popup
My project is in . NET MVC 4 and I’m having trouble calling the datepicker. It is applied but the popup is small above the field and blank. I want to use it in that field: @Html.TextBoxFor(model…
-
1
votes0
answers45
viewsGenerating two Checkbox tags being a Hidden in Aspnet MVC
Goodnight @Html.CheckBox("Agree", new { value = false, @class = "filled-in", @id = "filled-in-box" }) When I Checkbox in Aspnet, by the above command, it is generating me two Tags being that one is…
-
1
votes0
answers23
viewsReturn inside the control does not send to the right maproute
Good afternoon, I’m trying to use maproute to control editing and inserting data in the table, currently my routeConfig is like this: public static void RegisterRoutes(RouteCollection routes) {…
-
1
votes1
answer125
viewsHow to send a special character to the view , Asp.net mvc?
I have a situation where I would like to position the page in the same position as the container I was in before sending the Get? Example : <!-- ==== contato ==== --> <div class="container"…
-
1
votes2
answers45
viewspassing a complex object to MVC4 controller
I’m using MVC4 C#, I have a table that is generated dynamically according to the user’s decision, in this format: generated by js <tr class="itemPedido"> ' + '<td class="col-sm-1">' +…
-
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…