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
5
votes
1 answer

MVC ActionResult for large video files

I am using ASP.NET MVC 4 for a web site. The site manages online events for our group and gives registered users access to online materials, archives of web events and instructional videos. I have built a system for uploading and managing the…
drobertson
  • 1,548
  • 3
  • 14
  • 25
4
votes
1 answer

Existing MVC website - integrating Telerik MVC Grid to use ServerSideEditing

I have an existing MVC site, built some years back, and I am now removing all my custom grid code with Telerik's MVC Grid. I wish to utilise the ServerSide editing but the examples show the SourceCodeFile scaffolding on a single control…
4
votes
2 answers

Binding nested model with MVC3 on HttpPost

I am new to MVC3. I have a submit button on a form and I want to bind a model which has 2-3 nested object models with many properties inside. Is there a way to bind these nested objects without using EditorFor; so that when I submit the form I will…
4
votes
2 answers

actionresult to refresh current page

From some of the action methods I want to return a result that will force current page to refresh. I wrote this to acquire such result: public class RefreshResult : ActionResult { public override void ExecuteResult(ControllerContext…
objectbox
  • 1,281
  • 1
  • 11
  • 13
4
votes
2 answers

Returning an ActionResult from another ActionResult

Say I have the following code, mocked up in notepad, so excuse any minor errors :) //Default page public ActionResult Index() { var musicViewModel { Albums = GetTopSellingAlbums(5), Genres = GetTopGenres(5), …
boolean
  • 891
  • 2
  • 14
  • 23
4
votes
2 answers

How to return a StatusCode object outside of an MVC Controller

I'm refactoring an MVC controller into smaller pieces in different classes, and I've come to a part where I'm returning a "return StatusCode(500,"Some message")" item. It seems as though I'm not able to do this outside of a controller as far as I…
Steviebob
  • 1,705
  • 2
  • 23
  • 36
4
votes
5 answers

C# MVC Instant Response to Browser?

Again, asking MVC noob questions. Forgive my lack of experience. I have a situation where I am using an MVC route to return a large XML file. Sometimes it can be very large. Currently, I'm using a StringBuilder to build the XML output I want, and…
bopapa_1979
  • 8,949
  • 10
  • 51
  • 76
4
votes
1 answer

Redirection without losing request attributes in Struts 2

I would like to perform a redirection for my JSP page, which the URL will be changed to /folder/mypage.jsp, without losing my request attributes. Is there any way I can perform this kind of redirection in Struts 2?
ilovetolearn
  • 2,006
  • 5
  • 33
  • 64
4
votes
2 answers

Redirect user from controller to another view MVC

I'm trying to redirect a user from a method on a controller to another view but can't get it to work no matter what I do. What am I doing wrong? Here's my code: public ActionResult SubmitReport(string JsonStringSend) { …
Jeff Mcbride
  • 453
  • 2
  • 6
  • 19
4
votes
2 answers

How to construct a custom JSON error response using the Struts 2 framework

I am working on creating a web application using Struts 2. I want to send out JSON error response like the below when the request URL is not well formed: { “status”: 409, "code": 40924 “property”: “aggregation”, “message”: “aggregationId not…
Abhijith Madhav
  • 2,748
  • 5
  • 33
  • 44
4
votes
1 answer

how to get date value from the @using (Html.BeginForm(

In my razor view I have a simple form that's going to accept a date from user: @using (Html.BeginForm("CancelByDate", "ClassExample", FormMethod.Post, new { id = "dateForm" })) {
inside
  • 3,047
  • 10
  • 49
  • 75
4
votes
1 answer

Redirect from login interceptor in Struts 2

Our application requires users to be logged in to view any content. Access to all pages is intercepted by LoginInterceptor which brings up the login form if there's no valid session for the user. I'd like the interceptor to remember the original…
kosmičák
  • 1,043
  • 1
  • 17
  • 41
4
votes
1 answer

How to change ActionForward with dynamic params in Struts 2

While migrating the application from Struts 1 to Struts 2 In some of the places, the same action class has been used for different type of views, based on the request params. For example: if the createType is 1 means need to append one param or if…
john
  • 859
  • 2
  • 12
  • 25
4
votes
2 answers

WebResponse to HttpResponseBase. Is it possible?

In a controller action, I am manually sending a form to a remote URL using WebRequest. I successfully receive a WebResponse containing an html page to display. I would like to "paste" this response as the Response (of type HttpResponseBase) of the…
4
votes
4 answers

A custom ActionResult for a multi-part http response?

I'd like to respond to an http request with both a txt file and an html page. This way the client can save the file and see a summary of that file's contents via an html page. Since the file is generated on the fly, I have to use state management on…
Dane O'Connor
  • 75,180
  • 37
  • 119
  • 173