Questions tagged [actionresult]

The value returned by the Struts 2 Action class method when it completes.

The value returned by the Struts 2 Action class method when it completes. Actually, it returns a String type value. The value of the String is used to select a result element of the configuration. An action configuration will often have a set of result configurations representing different possible outcomes. A standard set of result tokens are defined by the Action interface are:

String SUCCESS = "success";
String NONE    = "none";
String ERROR   = "error";
String INPUT   = "input";
String LOGIN   = "login";

Further details are available: http://struts.apache.org/release/2.3.x/docs/result-configuration.html

457 questions
3
votes
2 answers

ActionResult redirect renders using ToString()

Using the following sample: http://www.west-wind.com/Weblog/posts/899303.aspx The following line... return req.RedirectingResponse.AsActionResult(); renders the string "DotNetOpenAuth.Messaging.OutgoingWebResponseActionResult". This is the class…
promontis
  • 155
  • 1
  • 11
3
votes
1 answer

Returning error message/page for FileResult in ASP.NET MVC

I'm using in the View to display image that exists as a local file in the server. getImage action in AccessFileController will look like public…
3
votes
1 answer

Display PDF(stored as a BLOB) as an image in MVC

I have to display a PDF(stored as BLOB in SQL Server table) in a partial view. I am doing the same for a ".jpeg" image stored as BLOB in the table.The image is getting displayed,however,the PDF isnt.I have the following code in my…
3
votes
2 answers

In C# MVC can you set a global behavior which each action method must carry out before processing the rest of the request?

I've got a rather large MVC web application and I am repeating an action in each controller to see if a customer has completed the application process (in which case a flag is set on their profile which I check against). Ideally I want to remove…
BenM
  • 4,218
  • 2
  • 31
  • 58
3
votes
1 answer

Struts2 jquery Plugin responds to ajax requests with HTML of the entire page

I am trying to use the Struts2 jquery plugin for ajax requests on some of my forms, but I am having an issue with the response to the page. The struts action is validated and executed properly, but when jquery gets a response, it sets the response…
Jon McPherson
  • 2,495
  • 4
  • 23
  • 35
3
votes
2 answers

Action error is empty when using Struts 2 dispatcher result

I am not getting action error, when I am using dispatcher result in Struts 2. In action class, the below code is used to add error message. addActionError("Error"); return "Failure"; In Struts config: ...
john
  • 859
  • 2
  • 12
  • 25
3
votes
1 answer

How to use MVC Action Results from regular web forms (faking ControllerContext)?

We have a pluggable framework that returns ActionResult objects that render things to a browser. One late breaking requirement is that our plugins should be callable from a regular ASP.NET Web Forms application. So far I have come up with this,…
intoOrbit
  • 2,122
  • 2
  • 19
  • 21
3
votes
1 answer

Why does ContentResult controller in ASP.NET MVC return UTF-16 when UTF-8 specified?

I have an ActionResult that returns XML for an embedded device. The relevant code is: return Content(someString, "text/xml", Encoding.UTF8); Even though UTF-8 is specified, the resulting XML is: The ASP.NET…
Todd Brooks
  • 1,167
  • 1
  • 13
  • 24
3
votes
2 answers

ParametersInterceptor - Unexpected Exception caught Error setting expression 'x' with value '

package com.achala.saraswathi.action; import com.achala.saraswathi.data.AdminBE; import com.opensymphony.xwork2.Action; import com.opensymphony.xwork2.ActionSupport; public class AdminLoginAction extends ActionSupport{ private AdminBE…
Naveen Kocherla
  • 399
  • 9
  • 27
3
votes
1 answer

How to get the Jquery Autocomplete result event handler to work?

I wrote code that fails to use the JQuery autocomplete to fire a result function after the user selects something valid (below). By result, I mean result handler, a function that fires after a good selection happens in the autocomplete plugin. …
Zachary Scott
  • 20,968
  • 35
  • 123
  • 205
3
votes
1 answer

Nested Model binding

---EDIT--- I have this model public class MainModel { string Name; List
Addresses; } public class Address { string prop2; } Is quite easy to create the view but I didn't find a way to bind it in the POST request. I would like to…
Davide
  • 1,305
  • 3
  • 16
  • 36
3
votes
4 answers

Run a URL string through the ASP.NET MVC pipeline to get an ActionResult

I have a list of URLs that I obtained by querying Google Analytics data. I want to run each of these URLs through the MVC pipeline to get the ActionResult. The action result contains the view model from which I can extract some important…
Ben Mills
  • 27,454
  • 14
  • 42
  • 38
3
votes
3 answers

All inbuilt ActionResults in ASP.NET MVC

I'm looking for a list of the inbuilt (and 3rd party would be a bonus) ActionResults you have available to you in a controller in ASP.NET MVC. So far I've discovered the following: ContentResult - this.Content() ActionResult - this.View()…
Chris S
  • 64,770
  • 52
  • 221
  • 239
3
votes
2 answers

The parameters dictionary contains a null entry for parameter 'id' of non-nullable type

I'm trying to retrieve data from my db via the id parameter in my default route: routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action =…
dtsg
  • 4,408
  • 4
  • 30
  • 40
3
votes
1 answer

Custom ActionResult and viewbag

I've writen a very simple Actionresult which derives from ViewResult public class FormResult : ViewResult { public override void ExecuteResult(ControllerContext context) { context.Controller.ViewBag.Form =…
user49126
  • 1,825
  • 7
  • 30
  • 53