1

Is there any way to prevent loading the same script in asp.net? Before I load any javascript file I want to check if that has been already loaded or not. I am using

Page.ClientScript.RegisterClientScriptInclude

to load javascript files

1 Answer 1

2

You can use:

if( !Page.ClientScript.IsClientScriptIncludeRegistered("myScript") )
    Page.ClientScript.RegisterClientScriptInclude("myScript", "url");
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.