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

  • Home
  • SEARCH
  • 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 8162907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:53:08+00:00 2026-06-06T18:53:08+00:00

I am using ASP.NET MVC 3 for the first time. I want to call

  • 0

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 object: “Person” = {Name: “aaa”, Age: 24}

I implement the ModelBinder neaded for such a parameter (Person). I am calling this action from the client with the following instruction:

var person= {}; 
person.Name = "aaa"; person.Age = 24;
var **url = '/Person/Add/' + $.param(person)**;
**window.location = url;**

This is my first program in Asp.NET MVC. I thing this is the right way to write the ‘url’.
Could you please help me to create the variable ‘url’ (needed to call the server action) in the right format ?

Thinks

  • 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-06-06T18:53:10+00:00Added an answer on June 6, 2026 at 6:53 pm

    You can pass that in the querystring like this

    var thatUrl = "/Person/Add?Name=aaa&age=24";
    thatUrl=encodeURI(thatUrl);  //Let's encode :)
    window.location.href=thatUrl;
    

    Assumuing you have HttpGET Action method which is looks like either

    public ActionResult Add(string Name,string Age)
    {
      //you will have the values in the argumens. Do something now
    }
    

    or

    public ActionResult Add(Person model)
    {
      //you will have the values in the object
      //check for model.Name & model.Age
    }
    

    assuming Name and Age are 2 properties of Person class

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

Sidebar

Related Questions

First time using Asp.net-mvc and originally followed the NerdDinner tutorial. My form submit button
I am using ASP.NET-MVC and nHibernate for the first time. Great tools, but big
I'm using ASP.NET MVC for the first time and so far everything has been
first time using Asp.Net MVC here. I have a model class defined with 3
Today is my first day using ASP.NET MVC, and I'm finding it very intriguing.
I wrote an application using ASP.NET MVC, in this application I have an Index
I am using asp.net mvc 2.0(default binding model) and I have this problem. I
I am currently working on an ASP.NET MVC2 project. This is the first time
I want to use partial views with AJAX calls in ASP.NET MVC, and this
We are developing an application in ASP.Net MVC 3 using jQuery UI Dialog. This

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.