.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Combining Actions into one action

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :ASP.Net

I want to do the following. I have a bunch of actions that return data (json). In certain scenarios I want to combine these actions into one that would sequentially execute the others to retrieve all the data in one shot instead of three webserver calls. Are there any mvc patterns that allow me to do this?



View Complete Post

More Related Resource Links

How can i route to different actions having same signature if i don't want to pass action name in U

I am having one controller Test having following actions (1)public ActionResult ABC (string parameter1, string parameter2)       (2)public ActionResult XYZ (string parameter1, string parameter2,string parameter3, string parameter4)       i have added following html.routelinks  <%= Html.RouteLink("ABC","ABC", new { parameter1 = 100, parameter2 = 200 } )%><br /> <%= Html.RouteLink("XYZ", "XYZ", new { parameter1 = 1000 , parameter2 = 2000 }) %> last two parameters in XYZ action are optionals so i have not passed them in Html.routelink  routes.MapRoute("ABC", "Test/{parameter1}/{parameter2}", new { controller = "Test", action = "ABC", parameter1= 0,parameter2=0 }); routes.MapRoute("XYZ", "Test/{parameter1}/{parameter2}/{parameter3}/{parameter4}", new { controller = "Test", action = "XYZ", parameter1=0,parameter2=0 ,parameter3=UrlParameter.Optional,parameter4=UrlParameter.Optional}); In above senario in both cases same route "ABC" is called eventhough i have clicked on second Html.routelink.can anyone solve this issue ? how can i route according to route name instead of number of parameters?

Custom action to actions- menu on "manage content and structure" sitemanager.aspx page


Hi all


I need to add custom action to actions menu of document library when user is in "content and structure" and can multiselect items from doclib. (doc lib is active in left side)


Any ideas how to add that?


By default the Action menu contains items copy,move,delete|checkout,discard checkout, checkin,publish,unpublish


Other option would be to add multiselect support to doc libraries.


Thanks for the ideas in advance,




pass value from textbox to action, formcollection best way here?


Hi I'm building a e-commerce store and on quantity of product I'm going with a textbox. I thought I would ask how would you do this? a viewmodel to use a strongly typed textbox or just get the value of the textbox from the formscollection passed in to the action?

Thanks for any input

Combining two LDAP queries


Hey guys, I have these two queries I'd like to combine into one.  Is there any way of doing it?
Query 1: (&(!cn=SystemMailbox{*})(&(&(ou>="")(name=executive*)(objectCategory=organizationalUnit)(ou=*operations))))
Query 2: (&(!cn=SystemMailbox{*})(&(ou>="")(name=50*)))
Thanks in advance.

Hey guys, I have these two queries I'd like to combine into one.  Is there any way of doing it?


Advanced Basics: Predicates and Actions


The System.Array and System.Collections.Generic.List classes provide methods that let you avoid writing code to loop through every element of an array or list to find the items you're looking for. Ken Getz explains.

Ken Getz

MSDN Magazine September 2006

Smart Tags: Simplify UI Development with Custom Designer Actions in Visual Studio


Windows Forms 2.0 components expose smart tags by utilizing Designer Actions. By taking advantage of this feature, you can add smart tags to your own custom components to make setting their properties and other actions much easier and developer-friendly.

Michael Weinhardt

MSDN Magazine July 2005

MVC 3 Preview 1. Inject value in Action Filter



I was reading MVC3 Preview 1 release and I found this:

Dependency Injection at all levels - We opened up seams for applying the dependency injection when instantiating components of the framework. This allows developers to hook into the creation of models during model binding, action filters, etc.

Does that mean I can inject a value into an Action Filter?

This is a problem I have for a long time and it would be really useful.

How can I do this?



Will MVC3 make possible to use IOC with Action Filters



Will MVC3 make possible to use IOC with Action Filters?

Is this on the roadmap?



MVC3: Define Dynamic ViewModel property inside Action Filter



How can I define a Dynamic ViewModel property in MVC 3 inside an action filter?

I am looking to have something like but inside the ActionFilter and not in the controller:

ViewModel.Title = "Home";

Thank You,


Delete spaces created by combining 2 fields


Howdy, this is kind of a continuation of an answer I got from this thread:  http://forums.asp.net/t/1592766.aspx

My users will enter a city/station where an incident occured, and the date.  The trigger below does work, but it will occasionally put spaces between the citystation and the date.  I think this happens when the citystaion name is not very long, but not sure.

(ex: city____08242010)

How can I make sure that if the incidentid is going to have spaces, that sql deletes those spaces?  I need the id to be space free.





TRIGGER [dbo].[tr_AddID1] ON [dbo].[tblIncidents] INSTEAD

How to hide 'no actions' on BDC toolbar


On my BDC list web part, I want the pager feature on the toolbar, but not the 'actions' drop down on the toolbar itself, since it never has any actions in it.

Follow up bonus question, why does that 'Actions' option appear there anyway?  It never has any actions that I can find.

Can you actually assign some sort of action there (as opposed to the line items actions in the web part).



Combining data from 2 lists, then summing a field


I have 2 lists, one is a contact list (client, client title, address, etc.), the other is a list of meetings with these clients (client name, type of meeting, date, etc.).  The 2nd list has multiple entries for the same client.  I am trying to create a report that combines the data in these lists and displays them like this:

Client--Client Title--MeetingType1--MeetingType2




In addition to combining the list data, I also need to break up the Type of Meeting field and sum the number of different types of meetings for each client.  I added the 2 lists to a linked source, then inserted the data into a DVWP adding data from the 2nd list as a joined subview.


I tried this: xsl:value-of select="count(/dsQueryResponse/Rows/Row[@TypeOfMeeting = 'MeetingType1'])" but it just returns 0.  I'm not sure if that's the correct method though as I think it will return a count of ALL the rows, not the current row.  Any ideas would be appreciated!

Somehow to pass a value to a action without having it on display in url?


Hi. I really cant figure this out but so I thought I would ask you. My scenario is I'm listing customers with paging. Lets say Im on page 4 and I choose to edit a customer. What I want to do is to be able to return to that page 4 when Im done editing the customer. How should I approach this?

Jquery Ajax Call to Mvc Action tips.


I try to do a ajax call via the jquery api.

The scritp :

$("#sortColumn").click(function(e) {
                var columnName = $(this).attr('name');
                var sidx = columnName;
                var sord = '<%= (string)ViewData["sord"] == "asc" ? "desc" : "asc"%>';
                var page = '<%= ViewData["page"] %>';
                var rows = "5";
                type: "POST",
                url: "/Mailings/GetData2",
                data: {'sidx': sidx ,'sord': sord ,'page': page ,'rows':  rows },
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function(response) {
                var jsonObject = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
                error: function(xmlHttpRequest, textStatus, errorThrown) {
                    document.getElementById('infoContentHeader').innerHTML = xmlHttpRequest.responseText;


And the

Displaying the Server Ribbon and Site Actions Menu on Customized Search Pages Upgraded to SharePoint

Learn how to add the Site Actions menu and SharePoint Server ribbon to SharePoint Server 2007 search pages that you upgrade to SharePoint Server 2010 by using visual upgrade.

Video: Visual Web Parts for SharePoint 2010 in Action

This video demonstrates how to build a Visual Web Part for SharePoint 2010. (Length: 5:03)

Video: Standard Web Parts for SharePoint 2010 in Action

This video demonstrates how to build a Standard Web Part for SharePoint 2010. (Length 4:36)
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend