Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7069043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:23:52+00:00 2026-05-28T05:23:52+00:00

I am having a problem while calling overloaded C# function through jquery post method.

  • 0

I am having a problem while calling overloaded C# function through jquery post method.

I have two functions in c#

string func(string a)
string func(string a, string b)

Now when i call function which has one parameter in jquery like this

var url = '<%= Url.Action("func", "Team") %>';                
$.post(url, { a: "test" }, function (data) {
});

It gives me this error

The current request for action 'func' on controller type 'TeamController' is 
ambiguous between the following action methods

I want to know how can i call these overloaded functions.
Im using Asp.Net MVC 2 with C#

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:23:53+00:00Added an answer on May 28, 2026 at 5:23 am

    ASP.NET MVC generally does not allow action overloads. If you want to do different things depending on content you’re sending to server then you should consider seprating processing between two functions with different names (different action names and different URLs apparently). If you want to keep the overloading in code then still you should decorate those functions with [ActionName("%some_name_here%")] attributes giving them different names.

    If you want to keep single action name then create a “Front-End” action with two parameters a and b and there in action code check if b==null. If b is null then call func(a) overload, otherwise call func (a,b).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am having a strange problem, while calling ajax jquery in asp.net.. i am
I have a flash file menu i am having problem while link it to
Hey dudes.i am having this problem while symlinking. I have successfully deployed a ruby
I'm having a problem with scala generics. While the first function I defined here
I'm having a problem in C++ with calling a function of a derived class
Hii I have a requirement of calling the variable in function which is having
I've been having this problem for a while and it's driving me nuts. I'm
I was having problems while intersecting two geometries, getting a TopologyException probably due to
I'm having a big problem when calling a web service from my WPF application.
I'm writing my first bit of jQuery, and I'm having a problem with jQuery.get()

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.