Any example for ResolveScriptReference? [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this questionCannot find any example on Google.
You can find an example in the ScriptReferenceEventArgs docs on MSDN
Off the top of my head, you may use it to append the version to the script path so the client updates any stale cached javascript when you release a new version, like this:
ScriptManager1_ResolveScriptReference(object sender, ScriptReferenceEventArgs e)
{
e.Script.Path += "?v=" + MyAppVersion;
}
SO uses this technique as well (though not the function, or webforms), look at the source of this page:
<link rel="stylesheet" href="http://sstatic.net/so/all.css?v=6638">
精彩评论