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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:50:41+00:00 2026-06-04T12:50:41+00:00

There are two things I do not understand too well in this scenario First,

  • 0

There are two things I do not understand too well in this scenario

First, there is a javascript that is in this format

function Allocate()
{
    this.Name = $("allocateName");
    this.AddAllocation = $("addAllocation");
    this.setCustom= $("setCustom");
}
... some other initializations here
Allocate.prototype.EnableAllocations = function() {

 this.enableAllAlloactions();
 this.setCustomAllocations();
}

This is just an example, so is this some kind of class in Javascript? this is in a file called Allocate.js.

My questions are the following:

If I was to call the EnableAllocations in a Page.ClientScript.RegisterClientScriptBlock(...); how would I do that?

  • 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-04T12:50:42+00:00Added an answer on June 4, 2026 at 12:50 pm

    You should instance the Allocate object, and call its EnableAllocations function.

      var alloc = new Allocate();
      alloc.EnableAllocations;
    

    So you can create a string with tha code and pass it using like this:

      Page.ClientScript.RegisterClientScriptBlock("key",
         "var alloc = new Allocate();alloc.EnableAllocations;");
    
    • NOTE: you can use this.GetType().FullName as key. You shouldn’t use the same key for different scripts.

    This method is deprecated. Use ClientScriptManager.RegisterClientScriptBlock Method instead (it depends on which version of the framework you’re using).

    Finally, I don’t know which library you’re using, but the $() comes from some library. So there’s a dependency on that library, and also on allocateName, addAllocation and so on.. whatever they’re.

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

Sidebar

Related Questions

There are two things I do not understand about this function : 1.Offset not
I'm not sure about one thing. There are two things in object oriented programming.
There are two things that seem to be popular nowadays and I was wondering
I saw this code in Ajax in Action book and there are two things
I have two things I need this for, these should explain what I mean:
The thing I hate most in CSS3 is that there is always two properties
I have read a document that they say: In java there two types of
There are two questions to this: How can I best spread the word about
Please understand that I'm not trying to bash RVM. I would just like to
There are two options when setting up your JBPM session. You can put your

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.