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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:49:39+00:00 2026-05-27T09:49:39+00:00

One of the apps I work on is a large ASP.NET 3.5 Web Forms

  • 0

One of the apps I work on is a large ASP.NET 3.5 Web Forms app that is used in the U.S., Central and South Americas, and Europe. We’re also starting to do more work with AJAX, and thus we need to settle on a strategy for localizing strings in our JavaScript controls.

For example, we have a control written as a jQuery plugin that formats data into a sortable table. The buttons and table columns need to be localizable.

We’re currently using two different approaches to handle this scenario, but I’m not completely satisfied with either.

  1. Write the bulk of the code in a jQuery plugin style, then place a script block on the .aspx page where we’ll pull in values from a .resx file and feed them into the plugin code. Here’s an example in pseudo code:

     <script>
        var view;
        $(function() {
            view = {
                columnHeaders: { 
                    productNumber = <%$ Resources:WidgetProductNumber_HeaderText %>, 
                    productDescription = <%$ Resources:WidgetProductDescription_HeaderText %> 
                }
            };
    
        });
    </script>
    
  2. Place the JavaScript in plain .js files with custom tokens in place of strings. We have a handrolled HttpModule that will parse JavaScript files and replace the tokens with values from any existing .resx file whose file name matches the name of the JavaScript file being processed.

Both approaches have problems. I’d prefer to keep our JavaScript code separate from our .aspx pages to make it more unobtrusive and reusable.

The HttpModule approach is clever but a little opaque to developers. I’m also looking to implement a JavaScript bundler called Rejuicer, which is also written as an HttpModule, and getting these to work together seems like it would require customizing the open source code. I’d prefer to use the code as it’s written so that we can upgrade it as the project progresses.

Are there any other tried-and-true strategies for approaching this problem in ASP.NET?

  • 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-27T09:49:40+00:00Added an answer on May 27, 2026 at 9:49 am

    It seems that both approaches are a little more complex/cumbersome than necessary. Keep it simple.

    1) Using an .ashx, custom http handler, or web service, create a .net object (anonymous, custom — doesn’t matter) that matches the client side JSON object.

    2) Populate server side object’s properties with the localized values

    3) Set the response content type to text/json or text/javascript.

    4) Using the JavaScriptSerializer class, serialize the object into the response stream.

    From the client side, you have two options:

    1) Use an AJAX call to the .ashx/handler/service to set your client side “view” object to the response JSON.

    2) Create a script tag with the src=”the/path/to/the/serviceOrHandler”. In this case you would need to include the js variable declaration in your response output.

    Let me know if you need a code sample.

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

Sidebar

Related Questions

I'm currently developing a moderately large sized web app with ASP.NET 2.0 that uses
One thing I see in some DDD enterprise apps that I work on, is
I cloned one of my own apps using Rails 3.1.3, created an app on
I have two apps (one for the iPhone, the other for the iPad) that
I have an app killing feature in one of my apps but up to
So I'm retesting one of my apps that I know works with iOS 4.2
I've run into a dilemma when working with apps that should support a large
I created two apps one free and one PRO and published them to the
I have built 2 apps: one for iPhone, one for iPad. They both build
I'm submitting an update to one of my apps. I've done this dozens of

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.