Hello,
in my .net-Project, I use a master page on which I dynamically register the jQuery-library.
public partial class Application : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
ScriptManager.RegisterClientScriptInclude(this, this.GetType(), "jquery", VirtualPathUtility.ToAbsolute("~/Materials/Scripts/jquery-1.4.2.min.js"));
}
}
I found out that this works for all pages that are bound to the master page, but that a script on the master page itself throws an error. I still have to use a hardcoded link to get it working. I would like to understand better why this is so, what´s the problem and how one could get around this.