0
活動網站分享
譚兆安
0
All services from your imperative.
• DisplayModeProvider
• audiojs
• Fastclick
• 注意事項
• 其他
議程
1 /23
All services from your imperative.
DisplayModeProvider
2 /23
All services from your imperative.
DisplayModeProvider
根據 User-Agent 顯示對應的 View
3 /23
All services from your imperative.
DisplayModeProvider
http://detectmobilebrowsers.com/
4 /23
All services from your imperative.
DisplayModeProvider
5 /23
All services from your imperative.
DisplayModeProvider
using System.Web.WebPages;
Global.asax Application_Start
Regex b = ...
All services from your imperative.
DisplayModeProvider
7 /23
All services from your imperative.
audiojs
8 /23
All services from your imperative.
audiojs
讓不支援 HTML5 Audio Tag 的瀏覽器
可以播放音效
9 /23
All services from your imperative.
audiojs
10/23
http://caniuse.com/
All services from your imperative.
audiojs
11/23
http://kolber.github.io/audiojs/
不支援 .ogg
All services from your imperative.
audiojs
12/23
<script src="@Url.Content("~/Scripts/audiojs/audio.min.js")"></script>
<s...
All services from your imperative.
fastclick
13/23
All services from your imperative.
fastclick
移除手機瀏覽器的 300ms delay 限制
14/23
All services from your imperative.
fastclick
https://github.com/ftlabs/fastclick
<script type="text/javascript" src="@Url....
All services from your imperative.
注意事項
16/23
All services from your imperative.
注意事項
• 使用 facebook 登入時,用轉頁的方式
window.location.href =
'https://www.facebook.com/dialog/o...
All services from your imperative.
注意事項
• 使用 facebook 登入時,用轉頁的方式
window.location.href =
'https://www.facebook.com/dialog/o...
All services from your imperative.
注意事項
• 使用 Elmah 時,建議使用 XML Log的方
式,當出現資料庫出現連線問題時,才有
記錄去偵錯
19/23
All services from your imperative.
注意事項
• Web.Config 加入 ipSecurity,限定特定
IP 讀取 Elmah
http://www.iis.net/configreference/sys...
All services from your imperative.
注意事項
• 使用無 NuGet 安裝的組件時,要記得手
動加入版控
21/23
All services from your imperative.
其他
• 在這次開發過程中遇到一個 DB 問題:
交易記錄檔已滿
22/23
All services from your imperative.
其他
• 在這次開發過程中遇到一個 DB 問題:
交易記錄檔已滿
原因:Server 硬碟空間滿了…
23/23
All services from your imperative.
感謝各位
Upcoming SlideShare
Loading in …5
×

活動網站分享

464 views

Published on

2014/4/11 多奇內部分享
對目前做過的專案中,有使用到的技術、問題做分享。

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
464
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

活動網站分享

  1. 1. 0 活動網站分享 譚兆安 0
  2. 2. All services from your imperative. • DisplayModeProvider • audiojs • Fastclick • 注意事項 • 其他 議程 1 /23
  3. 3. All services from your imperative. DisplayModeProvider 2 /23
  4. 4. All services from your imperative. DisplayModeProvider 根據 User-Agent 顯示對應的 View 3 /23
  5. 5. All services from your imperative. DisplayModeProvider http://detectmobilebrowsers.com/ 4 /23
  6. 6. All services from your imperative. DisplayModeProvider 5 /23
  7. 7. All services from your imperative. DisplayModeProvider using System.Web.WebPages; Global.asax Application_Start Regex b = new Regex(@"Detect Regex", RegexOptions.IgnoreCase | RegexOptions.Multiline); Regex v = new Regex(@"Detect Regex", RegexOptions.IgnoreCase | RegexOptions.Multiline); DisplayModeProvider.Instance.Modes.Insert(0, new DefaultDisplayMode("Mobile") { ContextCondition = (context => (b.IsMatch(context.Request.ServerVariables["HTTP_USER_AGENT"]) || v.IsMatch(context.Request.ServerVariables["HTTP_USER_AGENT"].Substring(0, 4)))) }); 6 /23
  8. 8. All services from your imperative. DisplayModeProvider 7 /23
  9. 9. All services from your imperative. audiojs 8 /23
  10. 10. All services from your imperative. audiojs 讓不支援 HTML5 Audio Tag 的瀏覽器 可以播放音效 9 /23
  11. 11. All services from your imperative. audiojs 10/23 http://caniuse.com/
  12. 12. All services from your imperative. audiojs 11/23 http://kolber.github.io/audiojs/ 不支援 .ogg
  13. 13. All services from your imperative. audiojs 12/23 <script src="@Url.Content("~/Scripts/audiojs/audio.min.js")"></script> <script> var as; if (typeof Audio === 'undefined') { audiojs.events.ready(function () { as = audiojs.createAll(); }) }; </script>
  14. 14. All services from your imperative. fastclick 13/23
  15. 15. All services from your imperative. fastclick 移除手機瀏覽器的 300ms delay 限制 14/23
  16. 16. All services from your imperative. fastclick https://github.com/ftlabs/fastclick <script type="text/javascript" src="@Url.Content("~/Scripts/fastclick.js")"></script> <script> $(function() { FastClick.attach(document.body); }); </script> 15/23
  17. 17. All services from your imperative. 注意事項 16/23
  18. 18. All services from your imperative. 注意事項 • 使用 facebook 登入時,用轉頁的方式 window.location.href = 'https://www.facebook.com/dialog/oauth ?client_id=FacebookAPIKey &scope=email,user_about_me,user_likes,publish_actions &state=code &redirect_uri=WebSiteUrl'; 17/23
  19. 19. All services from your imperative. 注意事項 • 使用 facebook 登入時,用轉頁的方式 window.location.href = 'https://www.facebook.com/dialog/oauth ?client_id=FacebookAPIKey &scope=email,user_about_me,user_likes,publish_actions &state=code &redirect_uri=WebSiteUrl'; • 前後台在同一網站下,且都使用 FormsAuthentication 寫 cookie 驗證時, 要注意後台的判斷 18/23
  20. 20. All services from your imperative. 注意事項 • 使用 Elmah 時,建議使用 XML Log的方 式,當出現資料庫出現連線問題時,才有 記錄去偵錯 19/23
  21. 21. All services from your imperative. 注意事項 • Web.Config 加入 ipSecurity,限定特定 IP 讀取 Elmah http://www.iis.net/configreference/system.webserver/security/ipsecurity <location path="elmah.axd" inheritInChildApplications="false"> <system.webServer> <security> <ipSecurity allowUnlisted="false"> <add ipAddress="127.0.0.1" subnetMask="8" allowed="true" /> <add ipAddress="192.168.2.0" subnetMask="24" allowed="true" /> <add ipAddress="58.86.49.32" subnetMask="27" allowed="true" /> <add ipAddress="61.62.220.19" subnetMask="32" allowed="true" /> </ipSecurity> </security> 20/23
  22. 22. All services from your imperative. 注意事項 • 使用無 NuGet 安裝的組件時,要記得手 動加入版控 21/23
  23. 23. All services from your imperative. 其他 • 在這次開發過程中遇到一個 DB 問題: 交易記錄檔已滿 22/23
  24. 24. All services from your imperative. 其他 • 在這次開發過程中遇到一個 DB 問題: 交易記錄檔已滿 原因:Server 硬碟空間滿了… 23/23
  25. 25. All services from your imperative. 感謝各位

×