locked
How Include Javascript file on condition in Page_Load RRS feed

  • Question

  • In Page_Load

       if (!IsPostBack){

           if ( condition ){

               //  load javascript file like

              //  <script type="text/javascript" src = "https://File_AA.js"></script>

          }  

          else

          {

              //  <script type="text/javascript" src = "https://File_BB.js"></script>

         }

    }

    Based on a condition How can I load a specific Javascript file?

    Is there another way I can do this?

    TIA

    Steve562


    Steve

    • Moved by CoolDadTx Thursday, July 23, 2020 1:29 PM ASP.NET related
    Thursday, July 23, 2020 12:38 PM

All replies

  • Please post questions related to web development in the ASP.NET forums.

    Michael Taylor http://www.michaeltaylorp3.net

    Thursday, July 23, 2020 1:28 PM
  • I was trying to put it in the C# forum.

    Not sure what happened.


    Steve

    Thursday, July 23, 2020 6:23 PM