Code:
Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "GoogleAPI", JavascriptCSS.GoogleAPI(), true);
Change true to false. Your HtmlGenericControl is already generating the script tags, however, I doubt that will work because you are returning a control and trying to present it as a string. You might be able to override the ToString() implementation, but I'd argue that isn't worth it.
Instead consider just return the HTML
Code:
public class JavascriptCSS
{
public static HtmlGenericControl GoogleAPI()
{
return "<script type=\"text/javascript\" src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js\"></script>";
}
}
And
Code:
Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "GoogleAPI", JavascriptCSS.GoogleAPI(), false);
Bookmarks