locked
add script to parent page from webcontrol RRS feed

  • Question

  • User-125499312 posted

    how would <g class="gr_ gr_18 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="18" data-gr-id="18">i</g> add a script to parent page from a webcontrol?

    thx for ur help

    Friday, December 7, 2018 3:50 PM

All replies

  • User475983607 posted

    how would i add a script to parent page from a webcontrol?

    thx for ur help

    What webcontrol? 

    Is there any reason why you can't simply add script reference or script tag on the page that requires the script?

    Friday, December 7, 2018 3:56 PM
  • User-125499312 posted

    because <g class="gr_ gr_8 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="8" data-gr-id="8">i</g> have a third party script that <g class="gr_ gr_87 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="87" data-gr-id="87">i</g> would like on all of my pages and it is easier to manage from a <g class="gr_ gr_138 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" id="138" data-gr-id="138">webcont</g>rol

    Friday, December 7, 2018 3:58 PM
  • User475983607 posted

    because i have a third party script that i would like on all of my pages and it is easier to manage from a webcontrol

    The common approach is adding the script to a master page.  Why do you want to "manage" the script?  Can you explain the problem you are trying to solve?

    Friday, December 7, 2018 4:04 PM
  • User-125499312 posted

    <g class="gr_ gr_11 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="11" data-gr-id="11">i</g> am using webforms - <g class="gr_ gr_43 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" id="43" data-gr-id="43">i</g> am not using master pages.

    i would like to turn off the script in one shot

    Friday, December 7, 2018 4:16 PM
  • User475983607 posted

    yzidell

    i am using webforms - i am not using master pages.

    i would like to turn off the script in one shot

    I don't get the problem you are trying to solve.  What does turn off the script mean?  How do you turn off a script?  Do you mean do not render the script?  If so, simply...

        <%
            bool someFlag = true;
            if (someFlag)
            {
        %>
             <script src="Scripts/site.js"></script>
        <%
            }
        %>

    Also, using master pages solves this problem as I understand the problem.

    Friday, December 7, 2018 4:41 PM