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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:13:20+00:00 2026-06-07T22:13:20+00:00

I have some records. Upon clicking on every record there information needs to display

  • 0

I have some records. Upon clicking on every record there information needs to display in an accordion.

That information is supposed to fetch from database dynamically.

What i’ve done so far is

Create a partial view. That is suppose to display the detailed information.

Upon click on record, i call jquery method and execute my method on controller. Controller returns object in the form of Json(or any other thing, open for any suggestions).

Now JQuery method has that (Model)object, but how could i use it to
render my partial view from it.

  • 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-07T22:13:23+00:00Added an answer on June 7, 2026 at 10:13 pm

    I have some records. Upon clicking on every record there information
    needs to display in an accordion.

    There are two ways you can achieve what you desire. I guess you have to return a partial view from the action that gives a detailed information about the record.

    1. Listening to the click event of the anchor links and inside the event you have to frame the url and then $("#accordion-container-1").load(url).

    Ex.

    From your comment I see you have to pass the orderNo the action as parameter. So you have to set the orderNo as id or append that to some string (to avoid duplicate ids in elements) and set to the id for the anchor link.

    Then,

    $(function(){
    
      $("a.somecssclass").click(function(){
    
         var orderNo = this.id;
    
         var url = "/ControllerName/Tracking?orderNo=" + orderNo;
    
         // this will call the action through ajax and update the container with the
         // partial view's html.
         $("#divToLoadTheHtml").load(url); 
      });   
    });
    
    1. Using ajax action links supported by MVC. You can create an action link using Ajax.ActionLink that call some controller action through ajax and update the html result to a container.

    Ex.

    In this case when you are generating the records through looping the collection you have to create the links (on click has to load the content through ajax) through Ajax.ActionLink method and also you have to include the jquery'unobtrusive.ajax.js library.

    @foreach(var m in Collection)
    {
        .. other stuff
    
        @Ajax.ActionLink(link name, "Action", new { orderNo = m.something? }, 
        new AjaxOptions
        { 
            UpdateTargetId = "somediv" // set the div name where you want to load the partial view
        });
    }
    

    Update based on OP’s comment

    Your action method should be something like this,

    public PartialViewResult Tracking(int orderNo) 
    { 
         var manager = new OrderManager(); 
         return PartialView(manager.Tracking(orderNo));
    }
    

    You should have a partial view either with the name Tracking.cshtml and inside the partial view you have to create the html the represents the detailed information of the record that you were talking about.

    Tracking.cshtml

    @model TrackingModel
    
    <div>
      @Html.DisplayFor(...)
      ...
    </div>
    

    When you call the action Tracking from jquery or through ajax action (as i described previously) you will get partial view html that you can load into a particular container like div.

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

Sidebar

Related Questions

I have some XML which contains records and sub records, like this: <data> <record
I have a table within my database that has many records, some records share
I have some existing projects that were built upon a deprecated PHP framework, and
I have some daily analytics-style records that track usage on my site, and they
I have some records inside an ObservableCollection. void proxy_AddPayNowOrderCompleted(object sender, AddPayNowOrderCompletedEventArgs e) { listBox1.ItemsSource
I have some records like this: ID Personel_Code Time --- ------------- ------ 1 0011
I have some records after SQL generating: YEARS MONTHS SUMMONTH SUMQUARTER QTR ----- ------
I have some dirty resource usage records in t_resourcetable which looks like this resNo
i have SOQL query which queries for some records based on a where condition.
I have created a View which prompts the user to input some records with

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.