Questions tagged [actionmethod]

Action methods typically have a one-to-one mapping with user interactions. Examples of user interactions include entering a URL into the browser, clicking a link, and submitting a form. Each of these user interactions causes a request to be sent to the server. In each case, the URL of the request includes information that the MVC framework uses to invoke an action method.

Most action methods return an instance of a class that derives from ActionResult. The ActionResult class is the base for all action results. However, there are different action result types, depending on the task that the action method is performing. For example, the most common action is to call the View method. The View method returns an instance of the ViewResult class, which is derived from ActionResult.

You can create action methods that return an object of any type, such as a string, an integer, or a Boolean value. These return types are wrapped in an appropriate ActionResult type before they are rendered to the response stream.

135 questions
0
votes
0 answers

Can't Download a file in authenticated page via internet download manager ASP.Net MVC

I have a Controller that lets a user that logged in can download a file that has been purchased. In My Controller I have an action like bellow //My custom attribute that authorizes user [FrontPanelAuthorize(Roles="user")] public…
0
votes
1 answer

Get null value in parameter in actionresult from actionlink click on different controller actionmethod

I am using Visual Studio 2015 with C# language and MVC version 4. I am calling the actionmethod on different Controller on actionlink click event. @Html.ActionLink(item.ListingDate.ToString("MM/dd/yyyy"), "MyActionMethod", "ControllerName", item.Id…
3 rules
  • 1,359
  • 3
  • 26
  • 54
0
votes
4 answers

Two Actions in Controler with Different Parameter Settings Conflict

I have two methods (Actions) with different option formats but when I run it I'm told they are ambiguous. Methods shown below. public ActionResult SelectInstitutionToEdit(){...} public ActionResult SelectInstitutionToEdit(string message){...}
physics90
  • 946
  • 3
  • 9
  • 24
0
votes
2 answers

How to Pass Parameters to Action Method

I have a controller DPN and within that controller, I have an Action Method [HttpGet] public virtual ActionResult Report(string reportName) { str_ReportPath = string.IsNullOrEmpty(str_ReportPath) ? "/BundleDealer/" + reportName : str_ReportPath; …
zaria khan
  • 333
  • 3
  • 8
  • 18
0
votes
1 answer

Common functionality across multiple ASP.NET MVC controllers

I'm working on ASP.NET MVC application & have a quick design question for you. So I need to implement a common functionality for all my controllers (well, most of them). I don't want to repeat the same logic in all the controllers. What'd be the…
DataPy
  • 209
  • 2
  • 10
0
votes
1 answer

Wix webhooks - why is my Callback URL action method not being called after an event in Wix?

I'm developing a Wix dashboard app, and I'm trying to use the Wix webhooks, so that Wix will make a call to our server when certain actions occur in the dashboard app (like installing the app i.e. the 'Provision - provision' event, removing the app,…
Chris Halcrow
  • 28,994
  • 18
  • 176
  • 206
0
votes
1 answer

asp mvc reload page every 30 seconds when browser is minimized

Actually we Play a notification sound when some update happens in database, so I am trying to reload a ActionMethod every 30 seconds when browser in minimized, this works fine in Firefox , but in Chrome this doesn't work. Scenario: Minimize the…
Shaiju T
  • 6,201
  • 20
  • 104
  • 196
0
votes
1 answer

Merge Grails request body and params into single command?

Currently in my action method I unmarshal the request body and request params into two separate commands. def someAction(BodyCommand bodyCmd) { ParamsCommand paramsCmd = new ParamsCommand(params) // Do something with bodyCmd and paramsCmd…
Marty Chang
  • 6,269
  • 5
  • 16
  • 25
0
votes
1 answer

How to use my own output for Action methods

How can I use my own output type for action methods in MVC? I know that its possible (as they did in MVC Contrib), but how?! I'm trying to use Silverlight as MVC Views.
Dr TJ
  • 3,241
  • 2
  • 35
  • 51
0
votes
1 answer

The type or namespace name 'T' could not be found While passing as a parameter to MVC Controller

I am passing T as a parameter & I am having this build error. This is my requirement public JsonResult SetGridProperties(Response res) { res.ShowFilterRow = (!res.ShowFilterRow); return Json(true,…
0
votes
2 answers

Is this a 'hack', and if so is there a better way to determine which ActionResult to return?

I have an A - Z directory 'widget' that I have on every page. If the user is on the home page and they click something in the directory, I want to load up the directory page with the corresponding result loaded. But if the user is on the directory…
DaveDev
  • 41,155
  • 72
  • 223
  • 385
0
votes
2 answers

Why is this View Model being populated when I pass "" into RenderAction?

I'm trying to implement a Widget control that exists on every page in the system, which will allow the user to have basic Search & Directory functionality available on each page. This is a tab control defined below, where in the
    the currently…
DaveDev
  • 41,155
  • 72
  • 223
  • 385
0
votes
0 answers

MVC 4 : ActionExecutingContext geting incorrect data

I have Action Filters which gets executed before every action method. In the first filter OnActionExecuting(ActionExecutingContext filterContext) the filterContext is having the wrong data. So I need to know from where the ActionExecutingContext…
TolerantCoder
  • 53
  • 1
  • 5
0
votes
1 answer

Why does the action method get wrong parameter?

I have the Action method and the View for editing properties of some items. [HttpPost] [ValidateAntiForgeryToken] [Authorize(Roles = "Admin")] public async Task Edit(Item item) { if (ModelState.IsValid) …
Vitalii Vitrenko
  • 9,763
  • 4
  • 43
  • 62
0
votes
1 answer

What is the Difference between Action Methods of MagicalRecord in iOS

Please explain the Difference between below mentioned methods. - (void)save: - (void)saveOnlySelfAndWait; - (void)saveToPersistentStoreAndWait; Note: Some one have posted answer of this question but i am not satisfied with that…
Ashok Londhe
  • 1,491
  • 11
  • 29
1 2 3
8 9