3

I was trying to access < script type='text/javascript' ....>< / script > existing within Head tag.

What I was doing to achieve that,

    foreach (Control ctrl in Header.Controls)
    {          
            Response.Write(ctrl.GetType() + "<br/>");
    }

It gives me the reference of "title", "meta" and "literal" control. How can I get the control and get the "src" attribute of that tag.

1 Answer 1

3

Does your <script> tag have runat="server"?

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

4 Comments

Thanks for your reply. No, it does not have.
@Hoque: you should try adding it!
I can get access of <meta> tag, <link> tag using the above way but unfortunately I can not get access of <script> tag. I would like to do without adding "runat='server'" . But if there is no other way I have to add the "runat" attribute.
As I have no response, I am going to use runat attribute to access <script> tag. Thanks to Egrunin.

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.