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

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

Two different action with the same name

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :ASP.Net

I have two actions with the same name:

        public ActionResult RegisterToEvent(string id)
return View();

public ActionResult RegisterToEvent(string id, int k)

// preoccessing data from Request.Params

return View();

I think everything clear here. But I don't like that parameter int k which I never use and which I pasted in order to create another function which will be launched when some data was posted to that action.

Is there any more esthetic way?

View Complete Post

More Related Resource Links

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

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,


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

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)

Action method returning an ActionResult used in a Action method


Hell all,

I have the Index action method calling a method that itself is an action method.

Example :

public ActionResult Index()
   //do stuff
   ActionResult result = MethodB();
   // ?? what to return here ??

public ActionResult MethodB()
   //do stuff

  return View("Index);

What to do in this case ?

Populate Treeview upon entered criteria and page action without complete page posting on client side


1. I have a treeview on left side in a panel in my aspx page and I have a Text box and a Search button on the right panel. On entering a search criteria and clicking the Search button, I want to get the data needed for the treeview (FYI - I have a webservice call for that) and then populate the treeview completely but keep it collapsed to the root node.

  Each time I enter the search criteria and click the Search button, I don't want to post the entire page (and also don't like the page flicker), how can I achieve this? I know that in order to avoid complete postback upon Search button click, I can do so by client callback and get the data needed for the treeview, but in this case, I have to build the treeview nodes as table - row/cells and handle all the events and handlers myself, which I want to avoid (also means that I won't be able to take advantage of the inherent expand and collapse capabilities of the Treeview). On the other hand, if I use the OnTreeNodePopulate event handling of the Treeview control, using the C# script code on the aspx markup, it doesn't recognize the entered criteria in the Text box. So either way,

Parallel Receive Action in Pick

HI,  i have a new question... yes, another :-) I have a Pick in my WF and three PickBranch. The trigger for every PickBranch is a Recive Activity. In my "Action" body i have some activities and, next, a Response Activity. So, when i revice a request from client, one of the trigger go on. That's ok. But how can i make the three Revice parallel? Normally when i had called Operation1, next call to Operation2 or Operation3 are serialized and served after the PickBranch of Operation1 is completed (because i have a While->True loop). But i would a way to start Operation2 and Operation3 (for example) in parallael, when, for example, Operation 1 is in exection. The Parallel Activity is not good for my scenario because i don't would made the calls for all Recive to complete the "Parallel".   Can anyone help me? Thanks

Problem using an action to link to a report in another site

Hi ! I'm using SSRS 2008 with WSS 3.0 (integrated mode) and I want, from a report in a site A, to link to a report in a site B. I'm using the full path to the report and when I paste it in a browser, it correctly shows the report. When I click on the link of the action in the report from site A, a report (having the same name) from site A is displayed instead... Any help would be appreciated Thanks Paul

MVC Route with multiple id: controller/action/id1/id2

Hi, I'd like to provide a route which handles a URL like this: 'http://my.com/Shop/Departments/Garden/Rakes' Is there a way to create a route which picks up & passes in the parameters 'Garden' and 'Rakes'? Or do I need to take 'Garden/Rakes' from one id parameter as a string and handle it myself? Thanks, +M    

Form Action Button to pass parameters through URL and how to fill a NewForm with them

Hi I'm trying to solve a bigger problem we have in babysteps, and I guess after days of searching and trying I simply need to ask for help. The big picture is, that we're trying to put a Form Action Button (via Sharepoint Designer 2007) above a custom DataForm DispForm.aspx which is supposed to navigate to a NewForm.aspx where the Title Field is supposed to be prefilled with a parameter from the DispForm and the user should be able to add information to the item before it is saved. I found several explanations from people on the internet, but nothing really worked. The first babystep would be to get the parameter through the button into the url of the new item.   < input type = "button" value = "Zugriff Beantragen" name = "btnFormAction0" onclick = "javascript: {ddwrt:GenFireServerEvent('__redirect={../Zugriff Beantragen 2/NewForm2.aspx?test={ItemID}')}" />   That's the code for my button. Somebody wrote that should definitely work because SharePoint is able to replace {ItemID} with the actual ID of the item. Well.... it kind of doesn't. What I get as the end of the new URL is exactly "...?test={ItemID}"   I tried with different names for the ID, I added an @ before those ... no change. I read somewhere about javascript.functionName() which should work with all parameters of the item, but

How to avoid warnings in SQL job when Action is taken "on Failure" is "quit the job reporting succes

Hi All, We have set Advanced property of a step On Success and On Failure action as Quit the Job Reporting Success. But it's giving Warning while executing. How can we ignore this warning ? Please suggest???? Thanks in advance.

Remove action that appear in the menu which appears when we right click each individual item in libr

i need to remove or hide edit properties menu from  menu which appears when we right click each individual item in library 

Custom Ribbon action using quick step for workflow

I created custom button using the quick step in ribbon, and configured to invoke a workflow. It shows start and stop page of workflow where I have to click start. How to start workflow directly from the ribbon without this redirection to page.  
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