How do I create a simple ‘Hello World’ module in Magento?

How can the following be accomplished in Magento? Display a “Hello World” message using a controller/view/model approach. So, if I went to http://example.com/myController it would show the string ‘Hello World’. Being able to show this string within the template of my website (for example, the header, footer, etc.) will be a bonus. How do I … Read more

Allow multiple roles to access controller action

Right now I decorate a method like this to allow “members” to access my controller action [Authorize(Roles=”members”)] How do I allow more than one role? For example the following does not work but it shows what I am trying to do (allow “members” and “admin” access): [Authorize(Roles=”members”, “admin”)] 11 Answers 11

How to create separate AngularJS controller files?

I have all of my AngularJS controllers in one file, controllers.js. This file is structured as follows: angular.module(‘myApp.controllers’, []) .controller(‘Ctrl1’, [‘$scope’, ‘$http’, function($scope, $http) { }]) .controller(‘Ctrl2’, [‘$scope’, ‘$http’, function($scope, $http) } }]) What I’d like to do is put Ctrl1 and Ctrl2 into separate files. I would then include both files in my index.html, … Read more

Multiple types were found that match the controller named ‘Home’

I currently have two unrelated MVC3 projects hosted online. One works fine, the other doesn’t work, giving me the error: Multiple types were found that match the controller named ‘Home’. This can happen if the route that services this request (‘{controller}/{action}/{id}’) does not specify namespaces to search for a controller that matches the request. If … Read more

Can an ASP.NET MVC controller return an Image?

Can I create a Controller that simply returns an image asset? I would like to route this logic through a controller, whenever a URL such as the following is requested: www.mywebsite.com/resource/image/topbanner The controller will look up topbanner.png and send that image directly back to the client. I’ve seen examples of this where you have to … Read more