Search Results

Search found 9456 results on 379 pages for 'controller'.

Page 6/379 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • set/add view from controller action

    - by user359650
    Hi all, I'm trying to set a view script to be executed in addition to the currently requested action view script. I want to do this from the controller action itself in a way that this new view script output will be available from the layout $this-layout()-content helper. I found the setView() method but don't know how to use it from the controller. Thanks a lot.

    Read the article

  • [ZF] set/add view from controller action

    - by user359650
    Hi all, I'm trying to set a view script to be executed in addition to the currently requested action view script. I want to do this from the controller action itself in a way that this new view script output will be available from the layout $this-layout()-content helper. I found the setView() method but don't know how to use it from the controller. Thanks a lot.

    Read the article

  • Controller name convention in ASP.NET MVC

    - by jesusbolivar
    Is there a way to change the naming convention for controllers in ASP.NET MVC? What I want is to name my controllers InicioControlador instead of InicioController, or better yet, use a prefix instead of a suffix, and have ControladorInicio as my controller name. From what I have read so far, I think I have to implement my own Controller Factory. I would be very grateful if any of you could point me in the right direction.

    Read the article

  • How can i Execute a Controller's ActionMethod programatically?

    - by Pure.Krome
    Hi folks, I'm trying to execute a controller's Action Method programatically and I'm not sure how. Scenario: When my ControllerFactory fails to find the controller, I wish it to manually execute a single action method which i have on a simple, custom controller. I don't want to rely on using any route data to determine the controller/method .. because that route might not have been wired up. Eg. // NOTE: Error handling removed from this example. public class MyControllerFactory : DefaultControllerFactory { protected override IController GetControllerInstance(Type controllerType) { IController result = null; // Try and load the controller, based on the controllerType argument. // ... snip // Did we retrieve a controller? if (controller == null) { result = new MyCustomController(); ((MyCustomController)result).Execute404NotFound(); // <-- HERE! } return result; } } .. and that method is .. public static void Execute404NotFound(this Controller controller) { result = new 404NotFound(); // Setup any ViewData.Model stuff. result.ExecuteResult(controller.ControllerContext); // <-- RUNTIME // ERROR's HERE } Now, when I run the controller factory fails to find a controller, i then manually create my own basic controller. I then call the extension method 'Execute404NotFound' on this controller instance. That's fine .. until it runs the ExecuteResult(..) method. Why? the controller has no ControllerContext data. As such, the ExecuteResult crashes because it requires some ControllerContext. So - can someone out there help me? see what I'm doing wrong. Remember - i'm trying to get my controller factory to manually / programmatically call a method on a controller which of course would return an ActionResult. Please help!

    Read the article

  • Magento config XML for adding a controller action to a core admin controller

    - by N. B.
    I'm trying to add a custom action to a core controller by extending it in a local module. Below I have the class definition which resides in magento1_3_2_2/app/code/local/MyCompany/MyModule/controllers/Catalog/ProductController.php class MyCompany_MyModule_Catalog_ProductController extends Mage_Adminhtml_Catalog_ProductController { public function massAttributeSetAction(){ ... } } Here is my config file at magento1_3_2_2/app/code/local/MyCompany/MyModule/etc/config.xml: ... <global> <rewrite> <mycompany_mymodule_catalog_product> <from><![CDATA[#^/catalog_product/massAttributeSet/#]]></from> <to>/mymodule/catalog_product/massAttributeSet/</to> </mycompany_mymodule_catalog_product> </rewrite> <admin> <routers> <MyCompany_MyModule> <use>admin</use> <args> <module>MyCompany_MyModule</module> <frontName>MyModule</frontName> </args> </MyCompany_MyModule> </routers> </admin> </global> ... However, https://example.com/index.php/admin/catalog_product/massAttributeSet/ simply yields a admin 404 page. I know that the module is active - other code is executing fine. I feel it's simply a problem with my xml syntax. Am I going about this the write way? I'm hesitant because I'm not actually rewriting a controller method... I'm adding one entirely. However it does make sense in that, the original admin url won't respond to that action name and it will need to be redirected. I'm using Magento 1.3.2.2 Thanks for any guidance.

    Read the article

  • Debian amd64 on Dell Studio 540 reboot hangs

    - by Shcheklein
    Hi, I have Dell Studio 540 desktop and Debian Lenny installed on it: 2.6.26-2-amd64 #1 SMP Tue Mar 9 22:29:32 UTC 2010 x86_64 GNU/Linux The problem is that I can't reboot it. It just hangs after "Will now restart" message. I've already tried: reboot=b, reboot=a, reboot=h kernel options. Nothing helps. Additional info (I can provide any other information): dmidecode System Information Manufacturer: Dell Inc. Product Name: Studio 540 lspci 00:00.0 Host bridge: Intel Corporation 4 Series Chipset DRAM Controller (rev 03) 00:02.0 VGA compatible controller: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03) 00:02.1 Display controller: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03) 00:1a.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #4 00:1a.1 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #5 00:1a.2 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #6 00:1a.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #2 00:1b.0 Audio device: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller 00:1c.0 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 1 00:1c.2 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 3 00:1c.5 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 6 00:1d.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1 00:1d.1 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2 00:1d.2 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #3 00:1d.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #1 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 90) 00:1f.0 ISA bridge: Intel Corporation 82801JIR (ICH10R) LPC Interface Controller 00:1f.2 IDE interface: Intel Corporation 82801JI (ICH10 Family) 4 port SATA IDE Controller 00:1f.3 SMBus: Intel Corporation 82801JI (ICH10 Family) SMBus Controller 00:1f.5 IDE interface: Intel Corporation 82801JI (ICH10 Family) 2 port SATA IDE Controller 02:00.0 FireWire (IEEE 1394): JMicron Technologies, Inc. Device 2380 03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)

    Read the article

  • Debian amd64 on Dell Studio 540 reboot hangs

    - by Shcheklein
    Hi, I have Dell Studio 540 desktop and Debian Lenny installed on it: 2.6.26-2-amd64 #1 SMP Tue Mar 9 22:29:32 UTC 2010 x86_64 GNU/Linux The problem is that I can't reboot it. It just hangs after "Will now restart" message. I've already tried: reboot=b, reboot=a, reboot=h kernel options. Nothing helps. Additional info (I can provide any other information): dmidecode System Information Manufacturer: Dell Inc. Product Name: Studio 540 lspci 00:00.0 Host bridge: Intel Corporation 4 Series Chipset DRAM Controller (rev 03) 00:02.0 VGA compatible controller: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03) 00:02.1 Display controller: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03) 00:1a.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #4 00:1a.1 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #5 00:1a.2 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #6 00:1a.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #2 00:1b.0 Audio device: Intel Corporation 82801JI (ICH10 Family) HD Audio Controller 00:1c.0 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 1 00:1c.2 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 3 00:1c.5 PCI bridge: Intel Corporation 82801JI (ICH10 Family) PCI Express Port 6 00:1d.0 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #1 00:1d.1 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #2 00:1d.2 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB UHCI Controller #3 00:1d.7 USB Controller: Intel Corporation 82801JI (ICH10 Family) USB2 EHCI Controller #1 00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev 90) 00:1f.0 ISA bridge: Intel Corporation 82801JIR (ICH10R) LPC Interface Controller 00:1f.2 IDE interface: Intel Corporation 82801JI (ICH10 Family) 4 port SATA IDE Controller 00:1f.3 SMBus: Intel Corporation 82801JI (ICH10 Family) SMBus Controller 00:1f.5 IDE interface: Intel Corporation 82801JI (ICH10 Family) 2 port SATA IDE Controller 02:00.0 FireWire (IEEE 1394): JMicron Technologies, Inc. Device 2380 03:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)

    Read the article

  • How much time do I have to remove a domain controller that was lost using metadata cleanup?

    - by dasko
    I am wondering how long after a Domain Controller has been permanently lost, from the domain due to it dying from hardware perspective, do I have before I have to clean up references of it using meta data cleanup? Planning on doing it soon but not sure if there is anything I should be concerned about. This dead or lost domain controller had no roles other than being a Domain Controller and having integrated Active Directory DNS. As well it held NO FSMO roles, it was just an older replication Domain Controller.

    Read the article

  • Zend framework controller action helper

    - by guptanikhilchandra
    I am getting fatal error after adding the action helper class. I am trying to load layout corresponding to called layout. Following is my code snippet: First of all i added a helper class under application/controller/helpers: class Zend_Controller_Action_Helper_Layout extends Zend_Controller_Action_Helper_Abstract { public $pluginLoader; public function __construct() { // TODO Auto-generated Constructor $this->pluginLoader = new Zend_Loader_PluginLoader (); } public function preDispatch() { $bootstrap = $this->getActionController()->getInvokeArg('bootstrap'); $config = $bootstrap->getOptions(); $module = $this->getRequest()->getModuleName(); if (isset($config[$module]['resources']['layout']['layout'])) { $layoutScript = $config[$module]['resources']['layout']['layout']; $this->getActionController()->getHelper('layout')->setLayout($layoutScript); } } } Then i added a loader in bootstrap.php: protected function _initLayoutHelper() { $this->bootstrap('frontController'); Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH .'/controllers/helpers'); $layout = Zend_Controller_Action_HelperBroker::addHelper(new Zend_Controller_Action_Helper_Layout()); } Following is my application.ini: [production] autoloaderNamespaces.tree = "Tree_" phpSettings.display_startup_errors = 0 phpSettings.display_errors = 0 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" resources.frontController.helperDirectory = APPLICATION_PATH "/controllers/helpers" resources.modules[] = "" contact.resources.frontController.defaultControllerName = "index" resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts" resources.layout.layout = layout admin.resources.layout.layout = admin admin.resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts" resources.view[] = [staging : production] [testing : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 [development : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 While running this code i am getting following errors: Warning: include(Zend\Controller\Action\Helper\LayoutLoader.php) [function.include]: failed to open stream: No such file or directory in D:\personal\proj\renovate\library\Zend\Loader.php on line 83 Warning: include() [function.include]: Failed opening 'Zend\Controller\Action\Helper\LayoutLoader.php' for inclusion (include_path='D:\personal\proj\renovate\application/../library;D:\personal\proj\renovate\library;.;C:\php5\pear') in D:\personal\proj\renovate\library\Zend\Loader.php on line 83 Fatal error: Class 'Zend_Controller_Action_Helper_LayoutLoader' not found in D:\personal\proj\renovate\application\Bootstrap.php on line 33 Kindly let me know, how can i come out from this issue. I am beginner in Zend Framework. Thanks Nikhil

    Read the article

  • Sd card bigger than 2gb is not recognized in ubuntu 12.04

    - by dex1
    When I insert a card up to 2gb it is immediately seen by the system but if try it with bigger one it's not seen. I presume the issue is not due to the card reader itself as it reads all cards under windows 7 but due to linux driver. I could see some people having similar issues but no solution. Any help appreciated. GParted doesnt see cards bigger than 2gb. After insertion small card ubuntu@ubuntu:~$ dmesg [10169.384481] mmc0: new SD card at address a95c [10169.384870] mmcblk0: mmc0:a95c SD016 14.0 MiB [10169.386715] mmcblk0: p1 everything worked fine then I removed the small one and put 8gb, waited for 2min [10295.736422] mmc0: card a95c removed [10362.448383] sdhci: Switching to 1.8V signalling voltage failed, retrying with S18R set to 0 [10372.480076] mmc0: Timeout waiting for hardware interrupt. [10382.496146] mmc0: Timeout waiting for hardware interrupt. [10392.512149] mmc0: Timeout waiting for hardware interrupt. [10402.528145] mmc0: Timeout waiting for hardware interrupt. [10402.529267] mmc0: error -110 whilst initialising SD card [10402.748807] sdhci: Switching to 1.8V signalling voltage failed, retrying with S18R set to 0 [10412.768063] mmc0: Timeout waiting for hardware interrupt. [10422.784051] mmc0: Timeout waiting for hardware interrupt. [10432.800076] mmc0: Timeout waiting for hardware interrupt. [10442.816067] mmc0: Timeout waiting for hardware interrupt. [10442.817165] mmc0: error -110 whilst initialising SD card [10443.040805] sdhci: Switching to 1.8V signalling voltage failed, retrying with S18R set to 0 [10453.056145] mmc0: Timeout waiting for hardware interrupt. [10463.072139] mmc0: Timeout waiting for hardware interrupt. [10473.088050] mmc0: Timeout waiting for hardware interrupt. [10483.104046] mmc0: Timeout waiting for hardware interrupt. [10483.104107] mmc0: error -110 whilst initialising SD card [10483.328960] sdhci: Switching to 1.8V signalling voltage failed, retrying with S18R set to 0 [10493.344144] mmc0: Timeout waiting for hardware interrupt. ubuntu@ubuntu:~$ lspci 00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 03) 00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (primary) (rev 03) 00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (secondary) (rev 03) 00:1a.0 USB controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 03) 00:1a.1 USB controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03) 00:1a.7 USB controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03) 00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03) 00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03) 00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 03) 00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 03) 00:1c.5 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 6 (rev 03) 00:1d.0 USB controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03) 00:1d.1 USB controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03) 00:1d.2 USB controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03) 00:1d.7 USB controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3) 00:1f.0 ISA bridge: Intel Corporation 82801HM (ICH8M) LPC Interface Controller (rev 03) 00:1f.1 IDE interface: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 03) 00:1f.2 SATA controller: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] (rev 03) 00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03) 07:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8072 PCI-E Gigabit Ethernet Controller (rev 16) 0a:01.0 FireWire (IEEE 1394): O2 Micro, Inc. Firewire (IEEE 1394) (rev 02) 0a:01.2 SD Host controller: O2 Micro, Inc. Integrated MMC/SD Controller (rev 02) 0a:01.3 Mass storage controller: O2 Micro, Inc. Integrated MS/xD Controller (rev 01) Same cards, same machine (same reader) only different OS(win7) work flawlessly. Some interesting reading I came across but is Chinese for me http://www.mail-archive.com/[email protected]/msg14598.html and another bit http://article.gmane.org/gmane.linux.kernel.mmc/11973/match=sd+card+not+recognized

    Read the article

  • Creating predefinied camera views - How do I move the camera to make sense while using Controller?

    - by Deukalion
    I'm trying to understand 3D but the one thing I can't seem to understand is the Camera. Right now I'm rendering four 3D Cubes with textures and I set the Project Matrix: public BasicCamera3D(float fieldOfView, float aspectRatio, float clipStart, float clipEnd, Vector3 cameraPosition, Vector3 cameraLookAt) { projection_fieldOfView = MathHelper.ToRadians(fieldOfView); projection_aspectRatio = aspectRatio; projection_clipstart = clipStart; projection_clipend = clipEnd; matrix_projection = Matrix.CreatePerspectiveFieldOfView(projection_fieldOfView, aspectRatio, clipStart, clipEnd); view_cameraposition = cameraPosition; view_cameralookat = cameraLookAt; matrix_view = Matrix.CreateLookAt(cameraPosition, cameraLookAt, Vector3.Up); } BasicCamera3D gameCamera = new BasicCamera3D(45f, GraphicsDevice.Viewport.AspectRatio, 1.0f, 1000f, new Vector3(0, 0, 8), new Vector3(0, 0, 0)); This creates a sort of "Top-Down" camera, with 8 (still don't get the unit type here - it's not pixels I guess?) But, if I try to position the camera at the side to make "Side-View" or "Reverse Side View" camera, the camera is rotating to much until it's turned around it a couple of times. I render the boxes at: new Vector3(-1, 0, 0) new Vector3(0, 0, 0) new Vector3(1, 0, 0) new Vector3(1, 0, 1) and with the Top-Down camera it shows good, but I don't get how I can make the camera show the side or 45 degrees from top (Like 3rd person action games) because the logic doesn't make sense. Also, since every object you render needs a new BasicEffect with a new projection/view/world - can you still use the "same" camera always so you don't have to create a new View/Matrix and such for each object. It's seems weird. If someone could help me get the camera to navigate around my objects "naturally" so I can be able to set a few predtermined views to choose from it would be really helpful. Are there some sort of algorithm to calculate the view for this and perhaps not simply one value? Examples: Top-Down-View: I have an object at 0, 0, 0 when I turn the right stick on the Xbox 360 Controller it should rotate around that object kind of, not flip and turn upside down, disappear and then magically appear as a tiny dot somewhere I have no clue where it is like it feels like it does now. Side-View: I have an object at 0, 0, 0 when I rotate to sides or up and down, the camera should be able to show a little more of the periphery to each side (depending on which you look at), and the same while moving up or down.

    Read the article

  • Simulate analogue steering wheel input from third party software like xPadder

    - by David Jensen
    So. I currently have a steering wheel connected to my htpc. Since it wont work / get recognized by all games i play. I use xpadder to play for example Grid 3. As far as i have understood, it simply presses the associated arrow key when i turn the wheel. What i would like, is a software to simulate more and more frequent key presses of the arrow keys the more i turn the wheel. Example: Tilting a little - 100 presses / second Tilting more - 200 presses / second Tilting max - Hold down key Because what i currently do with the wheel is constantly shaking it a bit right, when i just want to turn a little bit right and so on. Os : W8

    Read the article

  • Push/Present Modal View Controller

    - by Yakattak
    I have a table in my view controller (let's call it TVC1). I have rows in TVC1 that are used so the user can input some more data in addition to the data on TVC1. So, when someone taps a specific row in TVC1, it will show another view controller (let's call it TVC2). However, when TVC2 is shown, all of the data in TVC1 is cleared. How can I save the data in TVC1? Should I do it through the app delegate? DescriptionInputViewController *descriptionController = [[DescriptionInputViewController alloc] initWithNibName:@"DescriptionInputView" bundle:nil]; [self presentModalViewController:navController animated:YES]; [self.navigationController pushViewController:descriptionController animated:YES]; [descriptionController release];

    Read the article

  • Codeigniter: Retrieving a variable from Model to use in a Controller

    - by Craig Ward
    Hi, I bet this is easy but been trying for a while and can't seem to get it to work. Basically I am setting up pagination and in the model below I want to pass $total_rows to my controller so I can add it to the config like so '$config['total_rows'] = $total_rows;'. function get_timeline_filter($per_page, $offset, $source) { $this->db->where('source', $source); $this->db->order_by("date", "desc"); $q = $this->db->get('timeline', $per_page, $offset); $total_rows = $this->db->count_all_results(); if($q->num_rows() >0) { foreach ($q->result() as $row) { $data[] = $row; } return $data; } } I understand how to pass things form the Controller to the model using $this->example_model->example($something); but not sure how to get a variable from the model?

    Read the article

  • Design Patterns: What's the antithesis of Front Controller?

    - by Brian Lacy
    I'm familiar with the Front Controller pattern, in which all events/requests are processed through a single centralized controller. But what would you call it when you wish to keep the various parts of an application separate at the presentation layer as well? My first thought was "Facade" but it turns out that's something entirely different. In my particular case, I'm converting an application from a sprawling procedural mess to a clean MVC architecture, but it's a long-term process -- we need to keep things separated as much as possible to facilitate a slow integration with the rest of the system. Our application is web-based, built in PHP, so for instance, we have an "index.php" and an IndexController, a "account.php" and an AccountController, a "dashboard.php" and DashboardController, and so on.

    Read the article

  • My helper methods in controller

    - by FancyDancy
    My app should render html, to answer when a user clicks ajax-link. My controller: def create_user @user = User.new(params) if @user.save status = 'success' link = link_to_profile(@user) #it's my custom helper in Application_Helper.rb else status = 'error' link = nil end render :json => {:status => status, :link => link} end My helper: def link_to_profile(user) link = link_to(user.login, {:controller => "users", :action => "profile", :id => user.login}, :class => "profile-link") return(image_tag("/images/users/profile.png") + " " + link) end I have tried such methods: ApplicationController.helpers.link_to_profile(@user) # It raises: NoMethodError (undefined method `url_for' for nil:NilClass) and: class Helper include Singleton include ApplicationHelper include ActionView::Helpers::TextHelper include ActionView::Helpers::UrlHelper include ApplicationHelper end def help Helper.instance end help.link_to_profile(@user) # It also raises: NoMethodError (undefined method `url_for' for nil:NilClass) In addition, yes, I KNOW about :helper_method, and it works, but i don't want to overload my ApplicationController with a plenty of that methods

    Read the article

  • Reading out all actions in a Grails-Controller

    - by kenan
    Hi, i need to read out all available actions from any controller in my web-app. The reason for this is an authorization system where i need to give users a list of allowed actions. E.g.: User xyz has the authorization for executing the actions show, list, search. User admin has the authorization for executing the actions edit, delete etc. I need to read out all actions from a controller. Does anyone has an idea? Thx for any help! kenan

    Read the article

  • ASP.NET MVC pass information from controller to view WITHOUT ViewData, ViewModel, or Session

    - by josh
    I have a unique scenario where I want a base controller to grab some data and store it in a list. The list should be accessible from my views just as ViewData is. I will be using this list on every page and would like a cleaner solution than just shoving it in the ViewDataDictionary. After attempting to come up with a solution, I thought I would create a custom ViewPage with a property to hold my list. My custom ViewPage would inherit from System.Web.MVC.ViewPage. However, I do not know where MVC passes the viewdata from the controller off to the view. More importantly, how do I get it to pass my list down to the view? Thanks for the help.

    Read the article

  • Returning Json object from controller action to jQuery

    - by PsychoCoder
    I'm attempting to get this working properly (2 days now). I'm working on a log in where I'm calling the controller action from jQuery, passing it a JSON object (utilizing json2.js) and returning a Json object from the controller. I'm able to call the action fine, but instead of being able to put the response where I want it it just opens a new window with this printed on the screen: {"Message":"Invalid username/password combination"} And the URL looks like http://localhost:13719/Account/LogOn so instead of calling the action and not reloading the page it's taking the user to the controller, which isn't good. So now for some code, first the controller code [HttpPost] public ActionResult LogOn(LogOnModel model, string returnUrl = "") { if (ModelState.IsValid) { var login = ObjectFactory.GetInstance<IRepository<PhotographerLogin>>(); var user = login.FindOne(x => x.Login == model.Username && x.Pwd == model.Password); if (user == null) return Json(new FailedLoginViewModel { Message = "Invalid username/password combination" }); else { if (!string.IsNullOrEmpty(returnUrl)) return Redirect(returnUrl); else return RedirectToAction("Index", "Home"); } } return RedirectToAction("Index", "Home"); } And the jQuery code $("#signin_submit").click(function () { var login = getLogin(); $.ajax({ type: "POST", url: "../Account/LogOn", data: JSON.stringify(login), dataType: 'json', contentType: 'application/json; charset=utf-8', error: function (xhr) { $("#message").text(xhr.statusText); }, success: function (result) { } }); }); function getLogin() { var un = $("#username").val(); var pwd = $("#password").val(); var rememberMe = $("#rememberme").val(); return (un == "") ? null : { Username: un, Password: pwd, RememberMe: rememberMe }; } In case you need to see the actual login form here that is as well <fieldset id="signin_menu"> <div> <span id="message"></span> </div> <% Html.EnableClientValidation(); %> <% using (Html.BeginForm("LogOn", "Account", FormMethod.Post, new { @id = "signin" })) {%> <% ViewContext.FormContext.ValidationSummaryId = "valLogOnContainer"; %> <%= Html.LabelFor(m => m.Username) %> <%= Html.TextBoxFor(m => m.Username, new { @class = "inputbox", @tabindex = "4", @id = "username" })%><%= Html.ValidationMessageFor(m => m.Username, "*")%> <p> <%= Html.LabelFor(m=>m.Password) %> <%= Html.PasswordFor(m => m.Password, new { @class = "inputbox", @tabindex = "5", @id = "password" })%><%= Html.ValidationMessageFor(m => m.Password, "*")%> </p> <p class="remember"> <input id="signin_submit" value="Sign in" tabindex="6" type="submit"/> <%= Html.CheckBoxFor(m => m.RememberMe, new { @class = "inputbox", @tabindex = "7", @id = "rememberme" })%> <%= Html.LabelFor(m => m.RememberMe) %> <p class="forgot"> <a href="#" id="forgot_password_link" title="Click here to reset your password.">Forgot your password?</a> </p> <p class="forgot-username"> <a href="#" id="forgot_username_link" title="Fogot your login name? We can help with that">Forgot your username?</a> </p> </p> <%= Html.ValidationSummaryJQuery("Please fix the following errors.", new Dictionary<string, object> { { "id", "valLogOnContainer" } })%> <% } %> </fieldset> The login form is loaded on the main page with <% Html.RenderPartial("LogonControl");%> Not sure if that has any bearing on this or not but thought I'd mention it. EDIT: The login form is loaded similar to the Twitter login, click a link and the form loads with the help of jQuery & CSS

    Read the article

  • Passing Data from Usercontrol to controller

    - by nitinkhanna
    Hi, I am new to MVC, and trying something and got stuck somewhere in between. I have a user control there I have three textbox html type(ID, Lastname, firstname) and a submit buttom. I set the button like <input type="button" value="Search" onclick="location.href='<%= Url.Action("action", "controller") %>'" /> I have called this usercontrol on some view through <%= Html.Partial("ucName") %> Now on pressing that button(on user control) I need to pass the data from these textboxes to controller again to some specific action(Http Post action). By using this data I want to do some database interaction and storing the result in a dataset and pass this data set to same view again to show up in some Grid. I know the first part in conventional Asp.net can be done by raising the event through delegate but don't know how to do that in MVC.

    Read the article

  • Unit testing a controller in ASP.NET MVC 3

    - by Abdullah Al- Mansur
    public Double Invert(Double? id) { return (Double)(id / id); } I have done this for this test but fails please can anyone help with this cos just started with unit testing /* HINT: Remember that you are passing Invert an *integer* so * the value of 1 / input is calculated using integer arithmetic. * */ //Arrange var controller = new UrlParameterController(); int input = 7; Double expected = 0.143d; Double marginOfError = 0.001d; //Act var result = controller.Invert(input); //Assert Assert.AreEqual(expected, result, marginOfError); /* NOTE This time we use a different Assert.AreEqual() method, which * checks whether or not two Double values are within a specified * distance of one another. This is a good way to deal with rounding * errors from floating point arithmetic. Without the marginOfError * parameter the assertion fails. * */

    Read the article

  • CakePHP Auth how to allow specific controller and actions

    - by nolandark
    I have a "Posts" and a "Users" controller. I use the Auth Component and I want that all users can visit "Post.index" but only logged in users can visit "User.index". In my app_controller.php I have this $this->Auth->allow('signup', 'confirm', 'index'); but with that all users can visit post.index and user.index. How can I specify a Controller in the allow-method? This didn't work for me: $this->Auth->allow('signup', 'confirm', 'Post.index');

    Read the article

  • JSF 2 Content Controller (pull in content based on URI)

    - by gerges
    Hey All, I'm new to JSF and am trying to make a content controller. Basically whenever someone makes a request to www.myapp.com/external/** I'd like to forward to a controller that pulls external content into a page template and spits it out to the user. I was able to achive this pretty easily in Spring 3, but I'm a little confused on where to start with JSF. I feel like I'd need to create a custom servlet to handle /external/**? But what would the class of this servlet be? What would it consist of? Any help is appreciated!

    Read the article

  • How to add View Controller with Tab Bar interfaced View Controller

    - by TechFusion
    I have created Window based Tab Bar controller app, One Tab Bar of viewController has been interfaced with WebVIew ..I am looking to create another view once touch event happened in that WebView.. //TabBarViewController.m - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { TabMainView *mainView = [[TabMainView alloc] init]; mainView.hidesBottomBarWhenPushed = YES; [self.navigationController pushViewController: mainView animated:YES]; [mainView release]; } I have created MainView, which is UIViewController Subclass. //TabMainView.m - (void)loadView { CGRect frame = CGRectMake(0.0, 0.0, 480, 320); WebView = [[[UIWebView alloc] initWithFrame:frame] autorelease]; WebView.backgroundColor = [UIColor whiteColor]; WebView.scalesPageToFit = YES; WebView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleTopMargin); WebView.autoresizesSubviews = YES; WebView.exclusiveTouch = YES; //self.WebView.UserInteractionEnabled = NO; WebView.clearsContextBeforeDrawing = YES; self.view = WebView; [WebView release]; } - (void)viewWillAppear:(BOOL)animated { [self.WebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.apple.com"]]]; } Here when touch event happened then it is not passing control to TabMainView.m 's Viewload function although I am pushing it's view? TabBarView is also UIViewController subclass not a UINavigationController.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >