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
-
5
votes2
answers2664
viewsManipulate and model Json object
I have a JSON object with the following structure: [{ "Codigo": 7, "Descricao": "Atividade 1", "CodigoMilestone": 6, "TempoRevisado": 2, "Inicio": "\/Date(1445738400000)\/", "InicioCedo":…
-
5
votes1
answer923
viewsTips to improve the performance of an ASP.NET MVC site
I attended Devday 2015 and had the opportunity to participate in the Roberta Arcoverde about the architecture of Stackoverflow. I found her approach on the issue of performance interesting,…
-
5
votes1
answer354
viewsJSON output in a table
Good afternoon, And I put a search field, and as soon as the search is done, I popular a table with the users found.. The part of the query I managed to do, but now I’m not getting popular(actually…
-
5
votes1
answer1942
viewsError when running test project
I added a test project to my Solution to test the methods of my MVC application. I created a base class, for the other classes with tests to inherit from it, which contains context creation…
-
5
votes1
answer663
viewsViews do not recognize @model, @Viewbag, @Viewdata
I am using Mono 5.10.1 and Visual Studio Professional for Mac (Version 7.5.4 build 3) Views do not recognize tags like @model, @Viewbag and @Viewdata, either in older projects that were originally…
-
5
votes2
answers235
viewsHow can you clone cards on my website?
what is occurring is the following. I am currently trying to solve a big problem, two of the company’s online stores that I serve are having a problem with card cloning. I don’t have much experience…
-
5
votes1
answer1843
viewsTempdata C# doubt with MVC
I know that the TempData has its "life" maintained until it is used in the View. However, if I do it on two different controllers, the same one identified from the TempData, I’m killing and about…
-
5
votes1
answer138
viewsScroll Infinity ASP NET MVC C#
Good afternoon, I am implementing an infinite list in Asp net mvc and I have some questions about what is the best way to do this. I implemented using partial view, making a request via ajax and…
-
5
votes5
answers1041
viewslocalhost does not have access to the requested page
I’m trying to access a URL in AJAX but it’s making the following mistake: Xmlhttprequest cannot load http://receitaws.com.br/v1/cnpj/MEUCNPJ. In the 'Access-Control-Allow-Origin' header is present…
-
5
votes2
answers136
viewsComplex type bind with Angularjs
I am studying Angularjs and Asp.net MVC and could not bind a property CPF class Person when performing a POST: Classe Pessoa: public class Pessoa { protected PessoaFisica() { } public Int32…
-
5
votes3
answers7208
viewsHow to select Digital User Certificate in Web Applications?
I am developing a project in ASP.NET MVC5 to make manifestation of electronic invoices. During the process of searching notes, manifestation or download, I access the Internal Revenue Service and…
-
5
votes1
answer151
viewsHow to avoid repeating "using" in ASP.NET MVC?
I have a controller where several moments have a code similar to this: public ActionResult ListarProduto() { using (DBModels db = new DBModels()) { return View(db.Produto.ToList()); } } How not to…
-
5
votes2
answers3095
viewsHow to pass variables from Controller to View in ASP.NET MVC 4.5?
I’m quite used to PHP MVC where I can pass the values to the view from the controller as follows: public function Index(Users user) { return View('index') ->with('user', $user); } Or to return…
-
5
votes1
answer687
viewsCould not create a System.Object type constant value. Only primitive types or enumeration types are supported in this context
I am trying to make a query in LINQ, and is returning the following error message: Could not create a System.Object type constant value. Only primitive types or enumeration types are supported in…
-
5
votes2
answers801
viewsKeep table records synchronized between two different databases
We are performing a system migration, where some restructurings will be done in the current bank in a new bank. Basically I will have two banks BancoVelho and BancoNovo, having to keep both of them…
asp.net-mvc asp.net sql-server entity-frameworkasked 8 years, 7 months ago Pablo Tondolo de Vargas 5,444 -
5
votes1
answer303
viewsPass object to Webservice
I’m starting the development using Webservice + Windows Form and I did some silly methods passing parameters, however, I came up with the idea of passing an object as parameter where the Web Service…
-
5
votes1
answer130
viewsDifference in content formatting in Textarea and notepad
I have an ASP.NET MVC application where I display in a text area content that is in the database. @Html.TextArea("Avisos", Model.Avisos, new { @class = "form-control", rows = 50, style =…
-
5
votes2
answers650
viewsReference class Syntax Razor C#
I have a class where I have saved a configuration key being key and value, but I need to take the value of this key and move to my page cshtml. I’m having a hard time with this. I have already…
-
5
votes2
answers379
viewsHandle 404 error without using Try/catch
I have the following code snippet that makes an HTTP request, only that sometimes the URL does not work, then will be launched an exception by framework. HttpWebRequest request =…
-
5
votes2
answers839
viewsMy site does not find the Bootstrap and Jquery files
I created a website ASP.NET MVC with Code First and did the first publish of the application, the Database and the Site were created, the problem is that the site does not find the files css and…
-
5
votes2
answers56
viewsWhy is it that when I delete or edit the record from table x it is also removed from table y?
I have a system in ASP MVC with C# using Entity framework. I have the table Pedidos and Agenda. On the table agenda I have a column with the id of the request. When the order is canceled, I have to…
-
5
votes1
answer433
viewsAutomapper Entities Viewmodel
I am with a scenario where my context returns a query referring to two entities User and Cartaocreditousuario, as the following scenario below. During automapper action on my Viewmodel, is not…
-
5
votes1
answer261
viewsASP.NET MVC Scaffolding for any table
Someone knows a way for me to generate CRUD automatic to my bank tables using MVC? I have 5 tables and would like to generate SinglePage apps automatically for them, without having to generate…
-
5
votes1
answer51
viewsHow to reload the page after the message closes using Hubspot Messenger(). run()?
I’m making an MVC app and I need to re-load after the message closes (success or not). How can I do this? Codepen for testing: http://codepen.io/larissa/pen/rjOpRM/ HTML: <button class="btn…
-
5
votes1
answer137
viewsHow does the request session work?
An idea arose among the developers to use the standard of Session per request - Session by request. Researching on the subject, I found some topics in the OS that generally said that the indication…
-
5
votes1
answer257
viewsEntity Framework Async Performance
I am implementing an asynchronous webapi, and have tested two ways to return the value with EF6. The 1st form was using Tolistasync(), and the 2nd form was using Task. The 2nd form has a much better…
-
5
votes1
answer1118
viewsReturn Dowload Excel via MVC Controller
I have a method that generates an excel file and writes it in a directory, but then I take the path of the directory and I need to download the excel file, but nothing occurs, no error. Can anyone…
-
5
votes1
answer951
viewsGif to load while website loads!
I am developing a website (MVC), where there is a user option to select an Excel file, and all table data is sent to the database and only then appears a warning of success or failure when recording…
-
5
votes2
answers260
viewsHow to save changeable parameters in the system?
I have an ASP.NET MVC project and I use web.config to save some parameters that will be used by the system, but should not be changed by any user. Now I have to implement some other parameters that…
-
5
votes3
answers325
viewsIs it possible to override a base class property?
I have a class Cliente, which is the basis. In it I have the property Celular with Data Annotation "Required". I wonder if it is possible to use a property Cellular in class ClientePersonalizado,…
-
4
votes2
answers670
viewsWhat is the equivalent of Usercontrol in ASP.NET MVC?
In Web Forms we have UserControl. These controls have a code-Behind and a layout. They can be used in different projects/solutions without depending on other things. I want to create a control that…
-
4
votes2
answers442
viewsCode First with Complex Types, when making Scaffolding the properties of Complex Types are not found in the views
I’m following Sergey Barskiy’s presentation on http://www.youtube.com/watch?v=l3WzYZsN0gU, where it demonstrates the Entity Framework approach with Code First. I loved it, but I had a problem. In…
c# asp.net-mvc entity-framework code-firstasked 10 years, 10 months ago Guilherme de Jesus Santos 6,566 -
4
votes2
answers144
viewsCompare Dayofweek in an ASP MVC query
I’m trying to make a query where I check if the day week is chosen to create a list of data that loads in a Viewmodel. Query: var plan = db.Servicos.Where(s => (TecnicoResp.HasValue ?…
-
4
votes1
answer264
viewsSpecific application of attribute [Childactiononly]
I saw from the ASP.NET MVC documentation that the use of the attribute [ChildActionOnly] prevents the method from being called directly via GET, only through a specific view. Frankly, I don’t…
-
4
votes3
answers2237
viewsConstruct string with special characters
I am building PDF’s, and I need to print a string with special characters. I am constructing the string as follows (using iTextSharp): PdfPCell teste = new PdfPCell(new Phrase("<O meu texto>…
-
4
votes1
answer1871
viewsI am unable to make the value of a property selected using the Razor Helper Dropdownlistfor
Dear Ones, in my ASP.NET MVC 5 application I am using . Net 4.5 I am unable to make the option to be selected for a certain property. Example of my class: public class Funcionario {…
-
4
votes1
answer3291
viewsHow to pass parameter from one Controller to another in Asp.Net
Hello, I have an object that I need to pass by parameter to another Controller through the RedirectToAction, used the TempData but after any page change it loses the reference, know of any solution…
-
4
votes1
answer925
viewsPVC badge printing with thermal printer
I’m with a thermal printer to do some tests of printing badges with cards pvc. At first I set up a model badge on Reportviewer and I’m generating it in pdf. And apparently she’s losing a lot of…
-
4
votes1
answer2717
viewsHow to save and return images with Web Api?
How to send and return images from a Web Api from the Controller of an application Asp.net MVC? In my Controller of the project Asp.net MVC I get from View a picture like HttpPostedFileBase and need…
-
4
votes1
answer577
viewsRedirect to external URL with basic Authentication in MVC
I am developing a C# MVC3 portal and in a given operation I need to open another portal in a separate window. To open the page of this new portal I need to send some credentials, since this is…
-
4
votes2
answers6339
viewsColumn charts (Bootstrap)
I’m developing a system that needs to display column charts. The system is using Bootsrap and MVC 4 C#. Can anyone tell me if there is any framework for creating graphics?
-
4
votes1
answer446
viewsHow to internationalize Enum values?
I have the following code in Model: public enum Lista { [Display(Name = "Lista_regular", ResourceType = typeof(Mensagem))] Regular = 0, [Display(Name = "Lista_irregular", ResourceType =…
-
4
votes2
answers642
viewsUploads of files via ajax
How can I do several uploads, IE, I have a screen with several input of the kind file, how do I pass this via Ajax to my server? I’ve tried with Xmlhttprequest, but it didn’t work, it would if you…
-
4
votes2
answers275
viewsDar height and overflow-y in a div
I’m trying to give height and overflow-y in a div to limit the size of the div and add a scroll. Something like this: I’m uploading a list of data from the BD (I’m working on ASP MVC) to the div,…
-
4
votes1
answer148
viewsReflection Emit, what’s the point?
Passing a code to MVC, I saw there was a Label label= new Label(); that was underlined with red, when clicking to see the suggestions, I saw the following: using System.Web.Ui.WebControls using…
-
4
votes1
answer121
viewsPerformance to Render ASP.NET MVC Pages
How can I have greater performance to render my pages using ASP.NET MVC ?
-
4
votes4
answers1297
viewsDownload excel file
I created an excel file, but now the user needs to download, how can I do ? follows my method : public PartialViewResult ExportarParticipantes(int idPeriodo) { Regex reg = new Regex("[/ :]"); //…
-
4
votes1
answer2696
viewsHow to make a Viewbag.list receive a List<Keyvaluepair<string, string>>?
How should I pass a list (List<KeyValuePair<string, string>>) for view for ViewBag? My code: string grupo = "ConfigsPortalWebTextos"; List<KeyValuePair<string, string>> lista…
-
4
votes1
answer188
viewsPartial does not render
I have a problem with my application. What happens is that I am not able to render a partial in another view. Here the partial code: @model CEF01.Models.Ocorrencia @using…
-
4
votes2
answers324
viewsHow to define a fixed value attribute in ASP.Net MVC?
I have a user class that has the attribute permissão, that should always be 1. Where and how would I fix this value? In the folder models, controller or in itself view criminal record?…
asp.net-mvcasked 10 years, 2 months ago Ryan Santos 515