- 追加された行はこの色です。
- 削除された行はこの色です。
[[Open棟梁Project>http://opentouryo.osscons.jp/]] - [[マイクロソフト系技術情報 Wiki>http://techinfoofmicrosofttech.osscons.jp/]]
-[[戻る>ASP.NET の Modernization]]
* 目次 [#cb2dcf69]
#contents
*概要 [#p4222e1f]
コチラの内容をまとめた。
-Modify template : Link Bootstrap and jQuery from the template.~
https://github.com/OpenTouryoProject/OpenTouryo/issues/199
-Modify template : Correspond the JavaScript and CSS to bundle and minify, or to CDN.~
https://github.com/OpenTouryoProject/OpenTouryo/issues/200
-Modify template : Maintenance of the master page.~
https://github.com/OpenTouryoProject/OpenTouryo/issues/201
*共通項 [#le39c2c1]
[[コチラ>ASP.NET の Modernization]]を参照。
*[[BundleConfig>ASP.NET の BundleConfig]] [#b48396de]
基本的な事項は、[[コチラ>ASP.NET の BundleConfig]]を参照。
**Bundle & Minification [#wefbae22]
以下のように、[[BundleConfig>ASP.NET の BundleConfig]]を行い、Bundle と Minificationを可能にする。
***対象 [#nbca941f]
-respond.js~
IE8以下でレスポンシブWebデザインを実現する。
-WebFormsJs~
詳細は不明。情報が殆ど無い。
--WebForms.js
--WebUIValidation.js
--MenuStandards.js
--Focus.js
--GridView.js
--DetailsView.js
--TreeView.js
--WebParts.js
-MsAjaxJs~
JS file related to ASP.NET Ajax
--MicrosoftAjax.js
--MicrosoftAjaxApplicationServices.js
--MicrosoftAjaxTimer.js
--MicrosoftAjaxWebForms.js
***定義方法 [#z6ec33f3]
詳しくは、[[コチラ>https://github.com/OpenTouryoProject/OpenTouryo/issues/200]]を
-「BundleConfig」
-「Bundle.config」
-「RegisterBundles」
という検索文字列で検索。
**CDNフォールバック [#s8ee8670]
***ScriptManager [#x116b8c6]
[[ASP.NET Web Forms]]ではScriptManagerにCDNフォールバック機能が実装されている。
-アセンブリから取得する場合はCDNフォールバックの定義は不要。
-以下の場合は、CDNフォールバックの定義が必要になる。
--自前のScriptManager定義を使用する場合
--CDNフォールバック動作をカスタマイズする場合
***定義方法 [#s25dcf4f]
詳しくは、[[コチラ>https://github.com/OpenTouryoProject/OpenTouryo/issues/200]]を
-「<asp:ScriptManager runat="server">」
-「.AddDefinition(」
という検索文字列で検索。
**リンクのさせ方 [#xbdfa1a0]
***JS [#id2a0390]
Scripts.Renderメソッドと<asp:ScriptManager>タグを使用する方法がある。~
しかしながら、これら2つの方法の適切な使用が明確でないという問題がある。
-Scripts.Render
<title>・・・</title>
<asp:PlaceHolder runat="server">
<%: Scripts.Render("~/bundles/modernizr") %>
</asp:PlaceHolder>
-ScriptManager
<body>
<form runat="server">
<asp:ScriptManager runat="server">
<Scripts>
<%--ScriptManager のバンドル スクリプトの詳細については、http://go.microsoft.com/fwlink/?LinkID=301884 を参照してください --%>
<%--Framework スクリプト--%>
<asp:ScriptReference Name="MsAjaxBundle" />
<asp:ScriptReference Name="jquery" />
<asp:ScriptReference Name="bootstrap" />
<asp:ScriptReference Name="respond" />
<asp:ScriptReference Name="WebForms.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebForms.js" />
<asp:ScriptReference Name="WebUIValidation.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebUIValidation.js" />
<asp:ScriptReference Name="MenuStandards.js" Assembly="System.Web" Path="~/Scripts/WebForms/MenuStandards.js" />
<asp:ScriptReference Name="GridView.js" Assembly="System.Web" Path="~/Scripts/WebForms/GridView.js" />
<asp:ScriptReference Name="DetailsView.js" Assembly="System.Web" Path="~/Scripts/WebForms/DetailsView.js" />
<asp:ScriptReference Name="TreeView.js" Assembly="System.Web" Path="~/Scripts/WebForms/TreeView.js" />
<asp:ScriptReference Name="WebParts.js" Assembly="System.Web" Path="~/Scripts/WebForms/WebParts.js" />
<asp:ScriptReference Name="Focus.js" Assembly="System.Web" Path="~/Scripts/WebForms/Focus.js" />
<asp:ScriptReference Name="WebFormsBundle" />
<%--サイト スクリプト--%>
</Scripts>
</asp:ScriptManager>
***CSS [#f1858a71]
webopt:bundlereferenceと言うタブを使用するもよう。
<title>・・・</title>
<asp:PlaceHolder runat="server">
<%: Scripts.Render("~/bundles/modernizr") %>
</asp:PlaceHolder>
<webopt:bundlereference runat="server" path="~/Content/css" />
*[[RouteConfig>ASP.NET の RouteConfig]] [#z952e103]
基本的な事項は、[[コチラ>ASP.NET の RouteConfig]]を参照。
*参考 [#b3a19659]
-Adding Bundling and Minification to Web Forms – RickAndMSFT on Azure & MVC~
https://blogs.msdn.microsoft.com/rickandy/2012/08/14/adding-bundling-and-minification-to-web-forms/
**Bundle と Minification [#s832ac35]
-ASP.NET Web FormsでOptimizationを活用して、CSSとJavascriptを最適化するには? | sia.tech~
http://sianis.azurewebsites.net/?p=61
- [ASP.NET Optimization] javascript や cssの Bundle と Minification 機能を使ってみる - Netplanetes~
http://www.pine4.net/Memo/Article/Archives/545
- ASP.NET 4.5 ScriptManager Improvements in WebForms | .NET Web Development and Tools Blog~
https://blogs.msdn.microsoft.com/webdev/2012/09/21/asp-net-4-5-scriptmanager-improvements-in-webforms/
**CDNフォールバック [#fce577b9]
-効果的なフォールバック戦略の作成方法~
https://msdn.microsoft.com/ja-jp/library/hh273396.aspx
-jQuery, jQueryUI, Bootstrap利用時のCDNフォールバック対応 | auxak blog~
http://blog.auxak.com/cdn-fallback/
- CDNダウン時のjs/cssのフォールバック | odekakeshimasyo.me~
https://odekakeshimasyo.me/web-cdn-fallback.html
- パブリックCDNからのロードに対して、フォールバックを行う - Qiita~
http://qiita.com/jkr_2255/items/6c195a0de5e3ebaf4ac1
- ASP.NET アプリの高速化 : CDN の利用とフォールバック対応 – THE TRUTH IS OUT THERE~
https://blogs.msdn.microsoft.com/chack/2013/05/12/asp-net-cdn/
----
Tags: [[:.NET開発]], [[:ASP.NET]], [[:ASP.NET Web Forms]], [[:OWIN]], [[:NuGet]]