开发者

Any example for ResolveScriptReference? [closed]

开发者 https://www.devze.com 2022-12-24 17:47 出处:网络
Closed. This ques开发者_开发知识库tion does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This ques开发者_开发知识库tion does not meet Stack Overflow guidelines. It is not currently accepting answers.

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 question

Cannot 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"> 
0

精彩评论

暂无评论...
验证码 换一张
取 消