Hello Google User,
Here is what I've found out about your answer:
I added (basically) your code to my user control loaded event (which will inject the script tags that you're looking for). I don't have the global script that is contained in your gsJSHost
global variable so I substituted with the variable name.
This is my control code:
Public Partial Class MyControl
Inherits System.Web.UI.UserControl
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim tagLinks As String = "/Resources/Javascript/js/taglinks.js"
Dim scriptTagLinks As HtmlGenericControl = New HtmlGenericControl("script")
scriptTagLinks.Attributes.Add("type", "text/javascript")
scriptTagLinks.Attributes.Add("src", tagLinks)
Me.Controls.Add(scriptTagLinks)
Dim script As New HtmlGenericControl("script")
script.Attributes.Add("type", "text/javascript")
script.Attributes.Add("src", "gsJSHost")
Me.Controls.Add(script)
End Sub
End Class
This is my resulting page source:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
</title></head>
<body>
<form name="form1" method="post" action="Default.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUIMTI2NzczMzlkZE8ExRatvhvKqmX5DtpWJX8MhAcE" />
</div>
<div>
<script type="text/javascript" src="/Resources/Javascript/js/taglinks.js"></script><script type="text/javascript" src="gsJSHost"></script>
</div>
</form>
</body>
</html>
Please download the source code at my Google code demo project:
http://code.google.com/p/stackoverflow-answers-by-scott/
Direct link to zipped download:
http://stackoverflow-answers-by-scott.googlecode.com/files/1716701.zip
I hope this helps,
Thanks!