Questions tagged as 'asp.net-mvc'

1
answer

Retrieve view value for controller

Goal: Retrieve view value for controller [HttpPost] I created a generic class with gets and sets public int ListarDadosCarteira_Resultado { get; set; } public string ListarDadosCarteira_Descricao { get; set; } public int ListarDadosCart...
asked by 27.04.2016 / 21:47
1
answer

Performance while Rendering Pages ASP.NET MVC

How can I get more performance to render my pages using ASP.NET MVC?     
asked by 08.08.2014 / 22:08
1
answer

What are the differences between ViewBag, ViewData, and TempData?

I was researching how to pass data to a view , or rather persist the data of a controller to the view . I would like to know among the 3 ways mentioned in the title: What are the differences between them? In which cases is the use o...
asked by 01.02.2018 / 15:12
1
answer

How to check if a file is an image?

I'm working on an application using ASP.NET MVC and AngularJS and need to ensure that the file upload will be just image files, even if someone sends an extension of another type of ".jpg" for example. I'm getting a MultipartFileData in the...
asked by 22.06.2017 / 15:37
2
answers

CRUD with images, working with HttpPostedFileBase and byte []

We are using the EntityFramework with CodeFirst and DataBase PostgreSQL. There are some tables that should save images, and POCO classes are referenced as byte array. Up to this point everything is quiet. I can get the images with HttpPostedF...
asked by 25.08.2017 / 05:17
1
answer

Error in query with Dapper

Well, I'm trying to run a query on com with Dapper and get the following error:    The model item entered in the dictionary is of type 'System.Collections.Generic.List'1 [FertilityRate.Models.Pais]', but this dictionary requires an ite...
asked by 17.01.2017 / 17:26
1
answer

DataAnnotation validating property with Javascript plugin. ASP.NET MVC

I need to validate a field in my model that has a text editor in Javascript . So far so good, because the problem only occurs in the registry that I do not get in the Action parameter "Create" an object, but a FormCollection . In the...
asked by 16.07.2014 / 05:41
1
answer

Helper to write HtmlHelpers

I'm trying to write an HtmlHelper and seeing some basic examples I found one with the class TagBuilder already help : namespace MyNamespace { public static class MyHeleprs { public static MvcHtmlString Image(t...
asked by 02.07.2014 / 22:55
1
answer

Render pages within _Layout.cshtml of other types. Asp.Net MVC 4

I'm basically developing a kind of social network, however I'm having some problems rendering pages within my _Layout.cshtml page. Html <ul class="dropdown-menu"> <li class="header">Você tem @pUser.RequestsToAccept.Co...
asked by 21.05.2014 / 22:11
2
answers

Insert checkbox dynamically by Json return does not display Text?

I am creating a list of Checkbox according to the selection of a Select on the same screen. In the event change of select is called via ajax javascript , the method that returns a Json with list (valu...
asked by 14.01.2017 / 22:09