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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:26:25+00:00 2026-06-05T20:26:25+00:00

I have a web project in Asp.net MVC where in many pages, there is

  • 0

I have a web project in Asp.net MVC where in many pages, there is drop down list controls. When the value of these drop down list changes, a request to the controller action must be made to refresh some div tags.

To do that, I use the $(document).ready() function of jquery and I create a function like this:

$("#ComboBox").change(function() { /* do something here */ });

$.get('@Url.Action("Action", "Controller")', function (result) { 
    // TODO: process the results of the server side call
});

The problem is I don’t want to create a big javascript file that contains a list of all things that must be done in all pages when the document ready event of jquery occurs.

For example, in one page, I have a combobox that create a request to the action x of the controller x and in another page another combobox that create a request to the action y of the controller y.

I’m not sure if this is a good strategy to create a distinct javascripf file for each of these pages.

What can I do? Create a javascript for each specific document ready function? If I put all the functions in the same document ready function of the same javascript file, what about conflict naming in id and class referred by control with jquery? And if all the functions are in the same javascript, what about page that don’t use 90% of the functions in the document ready function.

  • 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-05T20:26:25+00:00Added an answer on June 5, 2026 at 8:26 pm

    When javascript gets more and more bigger in the client side you should really think about maintenance. jQuery is really easy to use but the problem is suddenly you will see the callbacks/handlers in many places makes difficult to manage. I would suggest you to use some kind of MVC library in the client side like Backbone.js that helps to organize the code in a better way.

    The second this as the development perspective we should separate out the complete javascript used in the application into separate files module/controller wise. You could use minification frameworks that helps to combine all the javascript into single file.

    The ASP.NET MVC 4 itself has the support of bindling/minification that helps you to combine and minify a set of js or css files.

    http://ofps.oreilly.com/titles/9781449320317/ch_ClientOptimization.html#BundlingAndMinification
    http://weblogs.asp.net/scottgu/archive/2011/11/27/new-bundling-and-minification-support-asp-net-4-5-series.aspx

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

Sidebar

Related Questions

I have the following project solution: There is a ASP.NET MVC Web Application where
I have asp.net mvc 4 web application project on my server in IIS Directory.
I have configured my Web.Config file as follow in a ASP.NET MVC 2 project:
We have an ASP.Net MVC project that will start with a single web server
I have a Silverlight project (with ASP.net MVC web project) Suddenly, when I press
I'm currently writing a project in ASP.NET MVC. I have a web project and
I have a standard ASP.NET MVC (RC Refresh) web project, with the standard ASP.NET
Say I have an application with the following structure. // ASP.NET MVC (Web Project)
I'm working on a Web project using Asp.Net MVC, which I'll have to deploy
I have inhherited a vs2010 c# web project (asp.net). It has a web reference

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.