Questions tagged as 'asp.net-mvc'

1
answer

What is the Level Trust of an ASP.NET application?

What is the Level Trust setting for an ASP.NET application? Does it protect the server from anything? Does it protect the application from anything? In which case or for what reason is it recommended or necessary to change this setting?...
asked by 31.10.2016 / 18:23
3
answers

Authorization of users to actions that use the Authorize attribute

I put [Authorize] in my controllers and entered this code: <authentication mode="Forms"> <forms loginUrl="/Login/Login" /> </authentication>' For every time code 401 occurs it redirects to the login page, but I...
asked by 18.11.2015 / 17:20
1
answer

What is Bind (Include="Property") used for?

When we create a CRUD with scalfold in ASP.NET MVC, in the POST methods, we have the following code: public ActionResult Create([Bind(Include = "Id,Nome")] Grupo grupo) {...} What is this [Bind] used for? When we use Gru...
asked by 29.12.2014 / 23:31
2
answers

View's Responsibilities

Throughout the internet, I find posts warning you of the responsibility of View who should only watch over your name and display content. While understanding that MVC is based exactly on the distribution of functions and separation of...
asked by 23.08.2014 / 13:26
3
answers

Return Json from object in C # with Entity Framework

I have a problem with returning a Json using Entity Framework. The code I'm using is: [AcceptVerbs(HttpVerbs.Get)] public JsonResult Item(int agendaHorarioID) { using (var db = new ERPContext()) { IList<AgendaHorario> age...
asked by 20.05.2014 / 13:47
2
answers

Rendering Partials in ASP.NET MVC

I'm having a problem in my application where I wanted to use partial to render one page inside another. That is, one controller inside another. But what happens is the partial does not render at all and I've done almost everything, but it does n...
asked by 15.05.2014 / 15:26
1
answer

Generate and download pdf file

Is there any specific configuration to generate pdf file on the server? The problem is that locally in my local project works perfectly and when I upload to the server the file is not generated, the page is rendered forever until it reaches the...
asked by 09.04.2016 / 00:15
2
answers

How ViewModel works in ASP.NET MVC

I have a situation similar to this question where I need to save multiple models at once and relate each one. I would need to kind of cascade save to first save one entity and then go save the others, because of relationships. Following t...
asked by 27.05.2016 / 03:43
1
answer

Execute insert in Migrations Entity Framework

I'm developing an ASP.NET MVC project with Entity Framework Code First. I've mapped the bank and managed the first Migrations, my question is: can I run a insert shortly after a table is created? Example: CreateTable( "dbo.P...
asked by 06.01.2016 / 23:08
1
answer

Do not find HttpContext.Current

I'm trying to create a UrlHelper as follows: UrlHelper urlHelper = new UrlHelper(HttpContext.Current.Request.RequestContext); I have already made reference to System.Web , as I saw it as a solution in several places. using System.We...
asked by 01.12.2015 / 19:09