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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:44:48+00:00 2026-05-28T06:44:48+00:00

Hi Everyone I am working on my first MVC 3 website built in C#

  • 0

Hi Everyone I am working on my first MVC 3 website built in C# in asp.net I am having some trouble with with the speed of the website as it takes over 45 seconds to expand or contract the tables that show the database.

I have included my code for the reportTemplate which has my jquery on it

I have been trying to figure out how to use cache but I am worried that the data will not be up to date when the managers need up to date data

@{
ViewBag.Title = "ReportTemplate";
}

<script language="javascript" type="text/javascript">
$(document).ready(function () {

    toggle = function (className) {
        $('.' + className).toggle('fast');
    }


});

</script>

<h2>ReportTemplate</h2>

<p>
@Html.ActionLink("Create New", "Create")    
</p>
<table>
<tr>
    <th>
        INVESTMENT AREA
    </th>
    <th>
        MAJOR PROGRAM
    </th>
    <th>
        MANAGER
    </th>
    <th>
        PROJECT
    </th> 
    <th>
        SPA
    </th>
    <th>
        PA
    </th>                                 
</tr>

@{
string investment_area = "";
string major_program = "";
string manager = "";
string project = "";
string spa = ""; 
string pa = "";
string iaClass = "";
string mpClass = "";
string manClass = "";
string pjClass = "";
string spaClass = "";
string paClass = "";
}
    @foreach (var item in Model)
{
iaClass = item.investment_area.Substring(0, 2);
mpClass = item.major_program;
manClass = item.manager;
pjClass = item.project;
spaClass = item.spa;
paClass = item.pa;

    if (investment_area != item.investment_area)
{

<tr>        
  <td class = "ndeTable ui-widget-header pointer border" onclick="toggle('@iaClass')" colspan="6">
        @item.investment_area
    </td>
</tr>

}
investment_area = item.investment_area;

if (major_program != item.major_program)
{

<tr class="@iaClass">
<td style = "width :200px"></td>
    <td class = "ndeTable pointer border" onclick="toggle('@mpClass')" colspan="5">

    @item.major_program

    </td>
</tr>    
}
major_program = item.major_program;

if (manager != item.manager)
{                
<tr class = "@iaClass @mpClass">
<td></td>
<td style = "width : 100px"></td>
    <td class = "ndeTable pointer border" onclick="toggle('@manClass')" colspan="4">    
    @item.manager
    </td>                
</tr>
}
manager = item.manager;

if (project != item.project)
{
<tr class = "@iaClass @mpClass @manClass">

<td></td>
<td></td>
<td style = "width : 200px"></td>

   <td class = "ndeTable pointer border" onclick = "toggle('@pjClass')" colspan="3">
   @item.project
   </td>
</tr>
}
project = item.project;

if (spa != item.spa)
{
<tr class = "@iaClass @mpClass @manClass @pjClass">

<td></td>
<td></td>
<td></td>
<td style = "width : 325px"></td>

    <td class = "ndeTable pointer border" onclick = "toggle('@spaClass')" colspan = "2">
    @item.spa
    </td>
</tr>
}
spa = item.spa;


<tr class = "@iaClass @mpClass @manClass @pjClass @spaClass">
<td></td>
<td></td>
<td></td>
<td></td>
<td style = "width: 200px"></td>
    <td class = "ndeTable pointer border" onclick = "toggle('@paClass')" colspan = "1">
    @item.pa
    </td>           
</tr>

pa = item.pa;
}
</table>

I am going to continue trying to optimize the code in the meantime but if anyone has any tips or tricks I can use I would be very thankful as this has been troubling me for the past couple days and 45 secs for a small database is ridiculous. Thank you for your time.
Cheers,
James

  • 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-28T06:44:49+00:00Added an answer on May 28, 2026 at 6:44 am

    Fire up sql profiler/sql trace and check out how many queries you are doing during single http request that creates the page. Queries are often the one to blame for performance issues. It’s nearly impossible that solely rendering the view takes so much time.

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

Sidebar

Related Questions

I am trying to do multiple counts everyone was working accept the first sub
First question here so hello everyone. The requirement I'm working on is a small
Hello everyone i am working on a project which requires me to export some
I'm working on an intranet MVC web application, using Fluent NHibernate. As everyone knows,
Hey everyone. I am working on an app that displays a modal the first
Hi everyone (first post!). I'm a JQuery and Javascript newbie. I'm working on the
Hey everyone, I am having a little trouble debugging my code. Please look below:
Working inside the context of an ASP.NET application I am creating a page that
Hello everyone :I am working on a .net mvc3 application. Here is my controller
Good evening everyone! I am working on learning some java and I have made

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.