Questions tagged as 'controller'

2
answers

Where should exception handling be performed to display to the system user?

What is the best place to handle an exception and send a message to the system user in a desktop application? In the controller, in the view or elsewhere?     
asked by 11.12.2015 / 00:34
2
answers

What can Model do in validation in MVC?

In an MVC project developed in PHP, should I validate what in model and what in controller ? Hash of passwords I'm doing in the set method of the model classes. Some validations that are not returned to the user I believe I should do...
asked by 07.06.2015 / 18:28
1
answer

Ajax running Controller (MVC, PHP)

I've just started to study mvc, and I have a question. How to make my ajax execute certain method of my controller. Note: I am not using any framework, here is the code below. View <div class="form-cadastro"> <input type="text...
asked by 06.05.2017 / 14:37
2
answers

How to receive the various fields of a view in the controller

I need to create an Insert from multiple fields at the same time! My system has multiple table and relationships and I am having difficulties at that point. I have this registration screen: Withthiscode:@using(Html.BeginForm()){<divstyle="wi...
asked by 15.10.2015 / 00:10
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

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
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

Why use IEnumerable?

I have the following code in a Controller: var carro = new List<SelectListItem> { new SelectListItem {Text = "Pegeout", Value = "Pegeout"}, new SelectListItem {Text = "Chevrolet", Value = "Chevrolet...
asked by 15.05.2015 / 03:34
1
answer

Compile directives from the Controller

I have a table that is rendered dynamically when passing an array of data to it. I have access to the data of each "row" as follows: { "data": function (data, type, val, meta) { return "<div style=\"color:green;\">" +...
asked by 29.07.2016 / 21:54
2
answers

Problem sending model to controller

I'm having trouble forwarding my model to the control: Class: public class Pessoa { public virtual long Id {get; set;} public virtual string Nome {get; set;} public virtual ETipo Tipo {get; set;} public...
asked by 31.03.2017 / 19:17