Questions tagged [controller-action]

51 questions
1
vote
1 answer

URL-ROUTING for Asp.Net MVC Action parameter binding

I am using ASP.NET MVC 3 for the first time. I want to call a controller action with a single parameter. this parameter is an object, not a simple type. Let's say: Controller = "Person", Action="Add", The single argument of this action is an…
0
votes
1 answer

Specifiying asp.net action inside the JS code

I am building a html table inside my JS code and I need to have something like click on me The inside of the a href needs to point to a controller action. The question is how do I do inside my JS?
sarsnake
  • 26,667
  • 58
  • 180
  • 286
0
votes
1 answer

Grails - Render a template by email

I have a controller's method which renders a template. This works fine to render the template within my .gsp view. I am also using the mail-plugin, and I would like to used the same controller's function to render the template by email, hence…
Alexandre Bourlier
  • 3,972
  • 4
  • 44
  • 76
0
votes
1 answer

Post mvc3 table to controller action

I have a simple table @using (Html.BeginForm("Save", "Subscription", FormMethod.Post)) { …
Anders
  • 17,306
  • 10
  • 76
  • 144
0
votes
1 answer

I can't get data to my controller without trigger action twice

Hello I can get every data but I can't get the ProductIds, it gives me null in the Handle functions request parameter. SelectedIds is not null, I can get it without problem in my action. I hope someone can help. EDIT: After some debugging I see that…
0
votes
2 answers

Zend Framework: How to call a Function (not a Controller Action) using ajax?

Assume that I have a public function in IndexController called test(): public function test(){ //some code here } In index.phtml view file, I want to use JQUERY AJAX to call test() function but have no idea about this. Code:
Nấm Lùn
  • 1,277
  • 6
  • 28
  • 48
0
votes
2 answers

Grails: Same URL Mapping to different actions per different HTTP methods

I'm using Grails v3.2.9 In official documentation I found the following for mapping to http methods: static mappings = { "/product/$id"(controller:"product", action: "update", method: "PUT") } But this is not enough. What I need is to have one…
Suren Aznauryan
  • 984
  • 10
  • 24
0
votes
2 answers

want to select image from server path and convert it to binary form

public class AdminController : Controller { public HHCCEntities hc = new HHCCEntities(); public ActionResult ServicesView() { var x = hc.Services.ToList(); return View(x); } [Authorize] public…
0
votes
0 answers

asp.net mvc, cascading drop down works from visual studio and iiexpress but not with IIS

My cascading drop down box work fine from within visual studio 2015 and iisexpress. But when hosting on IIS or selecting IIS as server in visual studio the controller action to populate the second drop drown box is not called! I'm new to Javascript…
Joerg
  • 1
0
votes
3 answers

Pass data from controller action helper to view automatically in Zend Framework

I have created an actionHelper with a preDispatch function. I want this preDispatch to send some data to my view. Any idea how I can achieve this?
Bryan
  • 645
  • 1
  • 6
  • 18
0
votes
0 answers

camel casing json results only for a particular api call

I am sending JSON result from my API in pascal case, but for only a particular web-api action I want to sent the response in camelCase. I can do it globally using settings.ContractResolver = new CamelCasePropertyNamesContractResolver(); But how…
harishr
  • 17,807
  • 9
  • 78
  • 125
0
votes
1 answer

After calling URL "/article/1234abcd" how to retrieve the value `1234abcd` from inside the `article` action?

@RequestMapping(value = "/article", method = RequestMethod.GET) public final String article(final ModelMap model) { } If this is called using the address: /article/1234abcd How can the value 1234abcd be retrieved from inside the article method?
Cornish
  • 899
  • 2
  • 9
  • 8
0
votes
0 answers

Test exception raising in controller

I have a simple controller action which is used for checking that the app is running. def check(id=1) Car.find(id) render nothing: true, status: 200 rescue render nothing: true, status: 500 end How do I test the exception. Below is the test…
margo
  • 2,927
  • 1
  • 14
  • 31
0
votes
1 answer

Creating a new Ruby on Rails action to update one Boolean value each time the link is followed

I have been Googling around for an answer to this for about an hour now after trying to get it to work with what i know about rails for quite some time and decided enough was enough. On my index page i want to create a button that acts like the…
0
votes
1 answer

post json string to mvc action via ajax comes null

I am posting a json object via ajax $('#btnOrder').click(function (e) { var jsonData = { ScheduleDate: '20/07/2015 17:00', UnitNumber: '425196', Length: 0.00 } var url =…
nickornotto
  • 1,946
  • 4
  • 36
  • 68
Name Report