Questions tagged as 'asp.net-mvc'

2
answers

Write access log in ASP NET MVC application

I have an ASP NET MVC website and I need to write to the database every time someone accesses the client's IP and access date, is there any way I can do that? I do not want to record every page that the client enters, just record when to open...
asked by 29.09.2016 / 15:38
1
answer

How to change the template (visual) of a page asp net mvc5 according to user

How would I do this using areas, and navigating through the main controllers (which are at the root of the project). Basically it is the following: www.algumacoisa.com/home/index = > redirect to the controller that will check t...
asked by 30.08.2016 / 05:58
1
answer

How do I get PDF content generated by Rotativa?

I'm using Rotativa for PDF generation from a .cshtml I can download the file through the application correctly using the command below: DadosConvite convidado = new DadosConvite(); convidado.nome = "teste"; return new Rotativa.ViewAsPdf("Conv...
asked by 24.11.2014 / 14:18
1
answer

Passing model via parameter dynamically in .NET MVC

I created this function to generate a handle (or slug , as you prefer) for the model users, the problem is that I would like to make it more "modular", so I can easily implement in any other model you also need to generate a handle...
asked by 24.06.2016 / 18:41
1
answer

How to separate a fixed route from a variable route with asp.net mvc5

I have a control that manages videos. I'm trying to do these two methods: [Route("video/categoria/{categoria}")] public async Task<ActionResult> Index(string categoria) { } [Route("video/categoria/new-movies")] public as...
asked by 04.11.2015 / 21:34
2
answers

Doubt with global variable in a controller

I have a method in my controller which is called through ajax. It populates a global variable within this controller . Is there any way I can access this global variable already populated by the first method if I call another ajax method o...
asked by 18.08.2015 / 19:42
1
answer

What are the good points of using View Engine Aspx instead of Razor?

When I search on ASP.Net MVC , I always find all examples of views with Razor (I do not remember exactly if I saw any in aspx) and in the past I remember that I could select this View Engine when creating a new one web applic...
asked by 05.03.2015 / 18:03
2
answers

What 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 displays multiple elements and so...
asked by 22.12.2013 / 01:30
1
answer

Lock or release a controller according to some condition

I have a controller that should only be accessed if an attribute in my table is "true". Is there any way the user can click on that link, check if the attribute is true, and then release the access?     
asked by 19.10.2014 / 04:37
2
answers

How to set a fixed value attribute in ASP.Net MVC?

I have a user class that has the attribute permissão , which should always be 1. Where and how would I do to set this value? In the folder models , controller or in the view of cadastre?     
asked by 04.09.2014 / 21:05