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 6385519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:54:35+00:00 2026-05-25T02:54:35+00:00

How to pass in .load function of jquery, the parameter include in url. url

  • 0

How to pass in .load function of jquery, the parameter include in url.

url recived in create.cshtml => http://…/Invoiced/Create/1
InvoicedDetail is a partialView , this contain list of details by id, this id is the parameter in ulr http://…/Invoiced/Create/1, how to cathc this parameter “1” to send in .load function ?

thanks.

Create.cshtml

    <p>Details list</p>

    <div id="InvoicedDetails_content"><div>

    <script language="javascript" type="text/javascript">
             $(document).ready(function () {
    //         parameter  = ?;
                $('#InvoicedDetails_content').load('/InvoicedDetail/Index/' + parameter);
            });

        </script>
  • 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-25T02:54:35+00:00Added an answer on May 25, 2026 at 2:54 am

    Never hardcode urls or any string concatenations. Always use urls helpers when you need to generate a url in an ASP.NET MVC application:

    <script type="text/javascript">
    $(function() {
        var url = '@Url.Action("Index", "InvoicedDetail", new { id = ViewContext.RouteData.Values["id"] })';
        $('#InvoicedDetails_content').load(url);
    });
    </script>
    

    In this example I am using the id parameter which assumes that you have this route parameter defined in your route definitions. Adapt the name if necessary.

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

Sidebar

Related Questions

can I pass variable (variable named test in this case) to jQuery .load function?
i have this jquery function that i want to pass topic parameter to, i
Can I pass form values in load() function of jQuery then be able to
I have this function in javascript: $('#myElement').load('/some/url/', { parameter1: 0, parameter2: 1 }); How
I need to pass an url from asp.net load_page to flowplayer javascript function here:
I have the following jquery code: $(.rotateNews).load(/load_news.php); var refreshId = setInterval(function() { $(.rotateNews).load('/load_news.php?newsID='); },
I want to use the argument I pass (this) in a JS function and
How can I pass args to the event handler function? This runs the function
i want to pass a function to another function as a parameter. I want
this is a general-purpose way to make GET requests with jQuery: var loadUrl="mypage.php"; $("#get").click(function(){

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.