1

I have been having an issue with one of my websites where it works perfectly fine while developing, but once it gets published and deployed on IIS, the styling for ONLY the account pages doesn't render, but the functional pages do render properly.

When I have a look in the console, it lists the following errors:

Uncaught SyntaxError: Unexpected token '<' (at modernizr?v=inCVuEFe6J4Q07A0AcRsbJic_UE5MwpRMNGcOtk94TE1:3:1)

1.
2.
3. <!DOCTYPE html>
   ^
4.
5.<html lang="en">
6.<head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>
Uncaught SyntaxError: Unexpected token '<' (at MsAjaxJs?v=D6VN0fHlwFSIWjbVzi6mZyE9Ls-4LNrSSYVGRU46XF81:3:1)

1.
2.
3. <!DOCTYPE html>
   ^
4.
5.<html lang="en">
6.<head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>
Uncaught SyntaxError: Unexpected token '<' (at WebFormsJs?v=N8tymL9KraMLGAMFuPycfH3pXe6uUlRXdhtYv8A_jUU1:3:1)

1.
2.
3. <!DOCTYPE html>
   ^
4.
5.<html lang="en">
6.<head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>
Uncaught ReferenceError: Sys is not defined at Login:61:1

Sys.WebForms.PageRequestManager._initialize('ctl00$ctl09', 'ctl01', [], [], [], 90, 'ctl00');
^^^

Of the first three errors, the page that the link takes me to shows the HTML for the login page, irrespective of if I'm looking at the login page, or any other account page, even though these pages should be showing JavaScript.

I've tried looking for a solution to this, but nothing I have found even relates to the problem I am facing.

The last error leads me to believe that AJAX isn't being loaded properly, and I have no idea why.

7
  • Are you using an UpdatePanel somewhere? And if the page returned by the UpdatePanel has a Response.Write then it could give issues. Commented Feb 12, 2024 at 7:28
  • @VDWWD No, there is no UpdatePanel anywhere on the site. The only thing AJAX is being used for is a calendar date selector on the main page of the site. Commented Feb 12, 2024 at 7:35
  • Did you add the ScriptManager correctly to the page? Secondly, please make sure that the script code is placed at the end of the page code. It would be helpful to provide a minimal code example that can reproduce the problem. Commented Feb 12, 2024 at 8:48
  • Does the AJAX call return what you think it does? If the call returns an error page then it can also generate that error. Commented Feb 12, 2024 at 8:57
  • How are you publishing this? Is this a web site, or a web site application? Have you tried publishing as debug vs release? Commented Feb 12, 2024 at 13:56

1 Answer 1

1

It seems like the fix to it was to add EnableCdn='true' to the <asp:ScriptManager>.

Once I did that, I stopped receiving the errors entirely, and all my styling loaded just fine after that.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.