Most voted "controller" questions
A Controller is responsible for controlling the entire flow of information passing through the site/system. It is part of the MVC standard.
Learn more…192 questions
Sort by count of
-
15
votes2
answers288
viewsWhere should exceptions be handled 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?
-
7
votes2
answers1353
viewsWhat can the Model do to validate the MVC?
In an MVC project developed in PHP, I should validate what in model and what in controller? Hash of passwords I’m doing in the method set of the classes model. Certain validations that are not…
-
6
votes1
answer1495
viewsAjax running Controller (MVC, PHP)
I just started to give a studied in mvc, and I have a question. How to make my ajax execute certain method of my controller. obs. I’m not using any framework, below is the code. View <div…
-
5
votes1
answer356
viewsHow to change the template(visual) of an Asp net mvc5 page according to user
Here’s the thing, I need to read a property that returns me 1,2,3... and with it I determine what kind of visual the page will have, template01,template02... how I would do this using areas, and…
-
4
votes1
answer275
viewsWhy use the 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 =…
-
4
votes2
answers1558
viewsGlobal variable query in a controller
I have a method in my controller that is called through ajax. It populates a global variable within that controller. Is there any way I can access this global variable already populated by the first…
-
4
votes2
answers335
viewsHow to receive multiple fields from a view in the controller
I need to create a multi-field Insert at the same time! My system has several tables and relationships and I am struggling at this point. I have this registration screen: With that code: @using…
-
4
votes1
answer2526
viewsRecover 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 {…
-
4
votes1
answer527
viewsCompile 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…
-
3
votes1
answer1236
viewsIdentify Area, Controller, and View Action
I need to create an Htmlhelper (MVC 4, C#) that identifies and tells what is the Area, Controller and Action of a View. I’m not getting anything. How can this be done? Is there a function or method…
-
3
votes2
answers202
viewsView . HTML with Vraptor. Is it possible?
I am a student of Analysis and development of systems and I love programming, I studied the basics of Java and I am searching frameworks just to get a sense. How do I return an HTML page in a…
-
3
votes1
answer230
viewsProblem switching from Controller to Model
I’m making a code where it involves MVC. To get past the View to the Controller I’m not having problems, but when will I pass the Controller to the Model I can’t do it, the variable is imported, but…
-
3
votes1
answer1172
viewsReturning JSON from a Factory to a controller with Angularjs
I’m starting to study angular more deeply, and am having problems processing JSON data into a Factory and passing them to a controller. My idea is: A simple app, just for study, where I type the…
-
3
votes3
answers7584
viewsCalling the Controller Method
I’m doing a project for the College, and I’m having a hard time understanding how to create a button and call an Actionresult in the Controller, and I was wondering if the action needs to be in the…
-
3
votes1
answer512
viewsHow to pass two variables from a view to the controller?
i have a link where I already pass a variable to the controller. It works ok. How do I pass two? My link in View: <a href="{{url("/ordemvar/$equipam->codigoequipamento")}}"><i…
-
3
votes1
answer287
viewsAngularjs - page does not find the controller
I’m starting to test applications using Angularjs and Spring Boot. My problem is this: All scripts are normally imported into the browser, but IF I tag "ng-controller="Headcontroller"" on any tag on…
-
3
votes2
answers1282
viewsHow to run a Function after entering the Controller in Angularjs?
I have the following problem, I have more than one state of navigation in the angular that uses the same controller, so: .state('app.estado-navegacao-1', { url: "/estado-navegacao-1", views: {…
-
3
votes1
answer888
viewsHow to apply the_content filter in get_the_content Wordpress function?
I am developing a theme for Wordpress, for hobby and to study a little PHP, Javascript etc. and I am facing a small problem. I’m working with the controller concept where all logic will be processed…
-
3
votes3
answers603
viewsProblem sending model to controller
I’m having trouble forwarding my model to control: Class: public class Pessoa { public virtual long Id {get; set;} public virtual string Nome {get; set;} public virtual ETipo Tipo {get; set;} public…
-
3
votes4
answers1005
viewsConvert Int to bool
Guys, I need some help from you if (usr.Excluido = 0) { ModelState.AddModelError("", "Usuário bloqueado."); return View(model); } The deleted variable is as bool on my system, I am doing a login…
-
3
votes1
answer323
viewsGroup items in application table Asp.net web MVC
How can I group items into a table? I am bringing these items from the database, I would like to group by the code of the same, for example, if there is repeated code 1 I would like to group it into…
-
3
votes3
answers666
viewsASP.NET - How to use multiple post methods in the same controller?
I have the following problem: On a given HTML page I have two buttons that call different POST methods in the same controller. @using (Html.BeginForm("UserInfo1", "UserInfo", FormMethod.Post)) {…
-
2
votes1
answer157
viewsFunctions - Model, Controller
In my model I have this function that defines the url format : public function url_format_category($category, $lang_domin) { if (lang('abbr') == 'en_US') $lang_domin = 'en/'; else if (lang('abbr')…
-
2
votes1
answer1588
viewsMVC - Doubt about controller and view PHP
I’m studying MVC a few days ago and I came across a question, I need a view to register, but this view would not do anything just send the data my doubt is that I need a control just to set up this…
-
2
votes3
answers198
viewsController with Repository, Ioc and DI
I’m trying to implement the recording of my views, Usuario repository in my controller, even using dependency injection examples, because in my user’s repository constructor it expects to receive an…
-
2
votes1
answer680
viewsRuby on Rails alphabetical order
I need to alphabetize my category: @posts_categories = Admin::PostCategory.all
-
2
votes1
answer145
viewsCustomize Json consumption - Web API
I have the following information on Json: [ { "$id": "1", "Cditemcontacli": 1.0, "Cdcontacli": 1.0, "Descricao": "Produto 1" }, { "$id": "2", "Cditemcontacli": 2.0, "Cdcontacli": 2.0, "Descricao":…
-
2
votes1
answer722
viewsLaravel - How to call a different action from store,update, Edit?
I created a action without being the standard of resource, how can I call the same for an action on form as I call the update and store. <form method="POST" role="form"…
-
2
votes1
answer92
viewsHow to insert information from a model that has a Relationship?
I have a listing of Products and this listing has the supplier code, I need to enter the name of the supplier in this listing. My Controller: public ActionResult Index() { IEnumerable<Produto>…
-
2
votes1
answer1006
viewsControllers and Routes in Node js
I wonder if it implies any difference between using only routes, or routes with controllers in the Node js, could someone give me some example of how to implement routes and controllers on Node…
-
2
votes1
answer101
viewsHow to change an attribute in the bank via a button
I’m creating a small college project in Ruby on Rails and I came across a problem: I have a table called Person and another call Tools. People have many tools and every tool and owned by one person.…
-
2
votes2
answers163
viewsController and service logic with Angularjs
I have some questions regarding the logic of the controller and service search functions. Follow an example of service: angular.module("myApp").factory("ProjetosAPI", function ($http, config) { var…
-
2
votes1
answer160
viewsHow to pass more than one parameter to a Controller?
I am in need of a backup to pass more than one parameter to a Creation Controller. I have some models as below: Usuario : Brings the information of the user who opened the call ex. id_usuario,…
-
2
votes2
answers434
viewsInput Submit does not call Actionresult
I’m having trouble calling Actionresult using input type="submit" and pass the model data. I did a test using ActionLink but Model is not sent. Someone could shed a light? Here is the code:…
-
2
votes1
answer182
viewsPass information between two PHP pages
good afternoon! I’m having the following problem: I have a page named php locality which has the fields "name" and "city". In the name field, I enter the name of the locality, as for example,…
-
2
votes1
answer23
viewsSystem of notes [params]
I am creating a system of appointments with clients, projects, activities, professionals and appointments, all parts pass and save correctly, except the part of the launch of the notes. Follow the…
-
2
votes1
answer152
viewsRor - Get controller Strong files inside the Application Controller
I am developing a logging process on my system (Rails 5), more specifically within the application controller. This process is being created there so I can add one before_save us controllers that I…
-
2
votes2
answers347
viewsCalling a controller action for views
I’m using Yii2 and doing a website project where one of the features is to list the movies linked to a specific user. I already have a method to associate movies to accounts and one that makes the…
-
2
votes1
answer825
viewsCall foreach result Controller checkbox and show in view
I need to recover a method in the controller and display in the view, Controller namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Models\Categoria; use App\Models\Sessoes; class…
-
2
votes1
answer48
viewsConversion error when sending input to controller to save
Good evening guys, I’m having trouble solving this problem, I hope you can help me... When trying to save data from View only one field returns this error: Failed to Convert Property value of type…
-
2
votes1
answer40
viewsNull Arriving Object List in Controller
I have a question and hope that someone can help me. I am not being able to send objects from my View to the controller. Every time it comes, it’s empty. I’ve tried a lot of things and I can’t seem…
-
2
votes2
answers93
viewsNo constructor without parameters has been defined for this object
I am creating an endpoint in an api and when a method request is made the API returns the error "No constructor without parameters has been defined for this object." even though a builder has been…
-
2
votes1
answer217
viewsCannot convert implicitly type "System.Collections.Generic.Ienumberable<SS_API.Model.Project>"
Cannot convert type implicitly "System.Collections.Generic.IEnumberable<SS_API.Model.Project>" em…
-
2
votes0
answers27
viewsContext User does not return username Asp Net Core 3.1 C#
I’m trying to get the username logged in by the User context inside a controller. I’m using Identity to manage login and JWT to authenticate requests in my controller. I can get the values:…
-
1
votes1
answer58
viewsUnknown Provider: ifFilterProvider <- ifFilter at the angle
I have next in my app.js (function(){ 'use strict'; angular .module('app', ['ngResource','ngRoute']) .config(function ($routeProvider) { $routeProvider .otherwise({ redirectTo: '/' }); })…
-
1
votes2
answers2436
viewsPass object array via javascript to the controller
How can I pass a javascript object array to the controller? JQUERY var array = []; var $linhas = $("#vendaTabela tbody > tr"); $linhas.each(function () { var x = { id: $(".codigo",this).text(),…
-
1
votes1
answer50
viewsCookie between controllers
I created the following cookie in the Locale controller: $cookie = new \Zend\Http\Header\SetCookie('localidade_id', $localidade->getIdentificador(), time() + 3600); However, when trying to access…
-
1
votes0
answers61
viewsRun controller from an external site
I have the following problem/question: I have the Wordpress installed and the CodeIgniter also. In Codeigniter I have to make a function that add +1 in the database when a category is seen in the…
-
1
votes1
answer105
viewsSelect Betweeen in data Cakephp
I’m trying to select records in a date range. $mesAtual = $this->requestAction(array('controller' => 'compras', 'action' => 'comprasMes'), array('condicoes' => array('Compra.status'…
-
1
votes2
answers158
viewsViews with php transition with the controller
I am a beginner in php, and so I have caught a lot. Also because I have used sublime text with apache and php installed separately (use Ubuntu with OS). Well my question regarding views and php is:…