We have a [UserNameFilter] ActionFilterAtrribute which populates the controller actions username parameter. This works nicely. However, when I use the Html.ActionLink helper stringly typed to the controller, the compiler requests said username parameter in the View.
Has anyone come across this and know how to recitify?
Controller Actio...
Hi,
I've been trying to do a messagebox in a controller in asp.net mvc, but every time I type MessageBox or MsgBox it doesn't give me the option to import a namespace...
What can I use that would be similar to a MessageBox?
...
Here's my method
[AcceptVerbs(HttpVerbs.Post)]
public void SaveImage(FormCollection formValues)
{
byte[] contents = Convert.FromBase64String(Request.Form["file"]);
System.IO.File.WriteAllBytes(Server.MapPath(Request.Form["name"]), contents);
}
It is getting posted to from this actionscript method:
...
I have created a component that is using a custom class. I added this component to an email template. When I try and load the template this is the error message I receive. List has no rows for assignment to SObject. From what I can tell the attribute I have created is not passing the value to my class.
Also, when I first pull up the t...
I have a form which users must fill out and submit. The controller action does some work and decides the user can have a file and so redirects to another action which is a FilePathResult.
[CaptchaValidator]
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Index(FormCollection collection)
{
// do some stuff ...
...
I'm trying to use the Supervising Controller pattern in a simple web application. My view is a sign up form and has many fields for a user to input (Think several pages of gmail sign up) This data will populate an entity, and this entity is processed when the user has submitted it.
For Example:
public interface ICreateAccountView
{
...
When I hit my module on this url http://localhost/xxx/index.php/TradeEnquiry I get this error
Fatal error: Call to a member function
setFormAction() on a non-object in
C:\wamp\www\stockdisplays\app\code\local\Stock\Tradeenquiry\controllers\IndexController.php
on line 55
Line 55 is this:
$this->getLayout()->getBlock('tradeen...
Hi,
I need several RSS feeds in my app. They are in a way similar to existing actions but with less options (no will_paginate, no sorting, only the most recent 20 results). So for example I have one action which shows all items tagged "amazing" and I also need one feed which shows the latest items tagged "amazing".
My question: Is it b...
Hi, I am having a problem with using session variables. I have two controllers named 'graduate_students_controller' and 'current_students_controller'. Each of these controllers control different view files. I am using session variables with both these controllers to store session information.
Here's the problem. Let's say I have two vie...
I have a controller action that checks
this.User.Identity.IsAuthenticated
What do you suggest how to tackle unit test on such an action?
...
Hi,
I'm just getting going with ASP.NET MVC and I'm also new to unit testing :) So far, so good.
I have a controller action that sets up an index view using a viewmodel. Testing the controller action is straight-forward as I can pass a fake service class in the controller's constructor, but my viewmodel is quite complex and fetches i...
I'm writing a rspec tests for my controller and i cannot find solution following problem.
For one of the edge case tests I need to verify the value of one instance variable.
How can i access it without having to define the accessor?
By default the usual:
controller.variable.should == '3.15'
doesn't work.
Defining
attr_reader :...
Hi there, in rails when you register filters in abstract superclasses they come before the filters registered in the controller class. Say I wanted to execute a method called authenticate as a filter right at the end of the filter chain. The only way I can figure it out is to declare that before_filter as the last filter in all my contro...
I am having difficulties testing Controllers in Codeigniter:
I use Toast but when I invoke my Home Controller class I get an exception that "db" is not defined. Has anybody an idea how to test this 1-1?
Thanks
class Home_tests extends Toast {
function __construct() {
parent::__construct(__FILE__);
// Load any models, libraries e...
Hi All,
I am now to MVC F/W. I developed an application where i need to Open a new URL (WHich comes from other server)
I developed and it worked in my Local Machine ... But when i try to run on DEV Machine it alwsys asks userID and Password.
Is it anything related to Credientals of the URL Opened. (I am able to open it when ...
In ASP.NET MVC is there a way to enumerate the controllers through code and get their name?
example:
AccountController
HomeController
PersonController
would give me a list such as:
Account, Home, Person
Thanks!
...
In the Prism Commanding_Desktop QuickStart solution, in the OrderModule, it defines a variable to the following:
this.container.Resolve<OrdersEditorPresentationModel>()
but where is this being registered so that it can be "resolved" out of the container? I see below where OrdersRepository is being registered, but I find no where in th...
I have the following identical code-block in all my controllers' beforeInterceptor blocks:
def beforeInterceptor = {
request.someField = Foo.someFoo(request)
if (!request.someField) {
redirect(...)
return
}
}
Repeating the exact same code fragment in all controllers violates DRY. Is there some standard Grails way to defi...
What is the best way to use controllers/views in CodeIgniter?
Is the following a bad way to go about making my pages?
function index()
{
$this->load->library('carabiner');
$this->load->view('include/head');
$this->load->view('include/home');
$this->load->view('top');
$this->load->view('featured');
$this->l...
Hi
I have a tabController-based iPhone application. First tab is associated with a table view controller. When I select a table cell I want to show another table controller view, but with different tabs on the bottom. What is the best way to do it? Change dynamically tab entries, or do it through IB? Please advise.
Thanks,
Nava
...