Hi,
I have an external javascript file which I include to my page on the code behind (as seen below).
My problem is, when I my page makes a postback (not partial one), I check the loaded scripts by using FireBug, and I cannot see the javascript file in the list after the post back. I asusmed once it is included to page on the first load, browser will be caching it so that I do not need to re-include it.
What am I doing wrong?
The way I include the script is here:
protected override void OnInit(EventArgs e)
{
if (this.Page.IsPostBack==false)
{
if (this.Page.ClientScript.IsClientScriptIncludeRegistered("ctlPalletDetail")==false)
{
string guidParamToHackBrowserCaching = System.Guid.NewGuid().ToString();
this.Page.ClientScript.RegisterClientScriptInclude("ctlPalletDetail", ResolveUrl(String.Format("~/clientScripts/ctlLtlRequestDetail.js?par={0}",guidParamToHackBrowserCaching)));
}
}
base.OnInit(e);
}