The ASP.NET MVC controller action methods are primarily used for handling 'business' operations but it can be used for lots more.
I thought it would be fun to see what creative, useful things people have created actions for that may be practical or useful for others.
Here's my contribution :
Javascript file concatenator - to reduce nu...
Hi folks,
i've got an action method like the following
public JsonResult Index(string version)
{
.. do stuff, return some data v1 or v2. Default = v2.
}
So, this action method returns some data, which can be formatted either as Version 1 or Version 2 (whatever output that is ... just know that they are schemantically different).
...
With ASP.net MVC is it possible to POST a form to a controller action which includes parameters not in the form, but from the URL?
For example
The Action method in GroupController:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Create(int idOne, int idTwo, Model model)
{ ... }
The route:
"{controller}/{action}/{idOne...
Hi everyone
I'm only a newcomer to ASP.NET MVC and am not sure how to achieve a certain task the "right way".
Essentially, I store the logged in userId in HttpContext.User.Identity and have written an EnhancedAuthorizeAttribute to perform some custom authorization.
In the overriden OnAuthorization method, my domain model hits the data...
So recently, I came up with a way to dynamically build a nav-bar menu where the Controller (And its Index ActionMethod) would be listed in a horizontal bar at the top of each page (via Site.Master) but also based on the user's assigned roles. Each Controller listed would also list (in a vertical drop-down) the ActionMethods available to ...
What are the benefits or detriments of either?
...
Hello i have just started learning mvc2 and im having a problem with the default value for the parameter page(you can see the method below).
Its always 0 regardless of what i type in the URL. For example this
h.ttp://localhost:52634/Products/List/2
should show page 2 but when in debug mode the page parameter is 0, so im always gettin...
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 <ul> the currently selected tab is determined by the the value in Model.CurrentTab and the corresponding conte...
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 page and they click something, I want to asynchronously load the result without doing a pag...