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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:53:03+00:00 2026-05-22T16:53:03+00:00

In my application more pages have got Script Manager in them hence my script

  • 0

In my application more pages have got Script Manager in them hence my script which depends on them loads but in some static pages the script manager is not present since none of features of Asp.net ajax is used.
but even though i register my client script like below i get Sys is undefined error, why is
that so.

if(Sys){
   Sys.Application.add_init(registerMyLibrary);
}

i had also tried below, but what the use when the above code itself throws error

if(Sys !== 'undefined'){
  //register my library
}

Is there some other way i can register my library without the error on my way??

  • 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-22T16:53:04+00:00Added an answer on May 22, 2026 at 4:53 pm

    This is because it (Sys) hasn’t been assigned in the global object or any shadowing context, which may be (read: likely is) another bigger issue.

    In any case, if (window.Sys) { ... } will work as expected.

    The problem is the lookup resolution for Sys fails and JavaScript raises the nice error (this is why the latter form with the !== also fails). This is not a problem when trying to access a property of the window object explicitly, as shown above. window is conveniently the global object in JavaScript in a browser.

    The window.Sys !== undefined variant can be used as well, but I dislike it. Another alternative is typeof Sys != "undefined", but I dislike this even more. (This works because typeof is a special operator and will not raise an exception if the lookup fails opting to return “undefined” — the string — instead.)

    Happy coding.

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

Sidebar

Related Questions

I have a ASP.NET web application which has more than 100 pages. Each page
I have an ASP.NET application where i have more than 100 pages.In each pages
I have an e-learning application with many flows with 10 and more pages. Now
To make my extranet web application even faster/more scalable I think of using some
Imagine a more complex CRUD application which has a three-tier-architecture and communicates over webservices.
I have got an application that is not compatible to work using IE8 browser.
We have a web application running in a production enviroment and at some point
I have a page in my wp7 application which need to display an image
Following the guide here, I have created a full-screen WPF application. But I met
I have a web application. On my page ive got this: <div id=myDiv runat=server

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.