2018年4月25日 星期三

EEP2015 錯誤訊息「無法載入檔案或組件'EFDesign,......」

解答:EEPNetServer的【WCF】菜單,點擊【Install Designer Component】

來源:http://www.infolight.com.tw/WebClient/DiscussDetail.aspx?ID=Mzc4NDkx&Author=&Target=X3NlbGY=&DataType=Mjg=

2018年3月2日 星期五

IE 列印自動縮放 (IE only 設定)

使用者如果使用IE,如果使用者不開啟自動縮小(檔案 -> 設定列印格式 -> 啟動自動縮小),列印頁面可能會無法全部顯示。
此時可設定只有列印才會使用的css,搭配 IE only 的 css
只有列印才會套用的css:
http://blog.darkthread.net/post-2009-11-06-css-media-types.aspx

@media print {
裡面放你要寫的class與樣式
}

附註:在cshtml裡面寫 @media衝突解決方式:
https://dotblogs.com.tw/kangting/2014/05/19/145178
(直接寫兩個@連用就好)

IE only css hack
https://gist.github.com/vidaaudrey/c16774076391d09e7ec7dbb7ed7a3189

此用法只能在 IE 9以下
IE 10以上
http://www.webhek.com/post/conditional-comments-in-ie11-10.html

2018年2月5日 星期一

IE11 ajax 不會觸發

因為IE有一個設定是自動判斷 ajax 資料是不是最新

網際網路選項 -> 瀏覽歷程記錄 -> 設定 -> Temporary Internet Files ->
檢查儲存的畫面是否有較新的版本 -> 設定為【每次造訪網頁時】
就會每次都觸發 ajax 更新

另一個方法是讓ajax不要讀快取
https://dotblogs.com.tw/jasonyah/2013/06/02/use-ajax-you-need-to-be-care

2018年1月16日 星期二

Fody 將所有參考套件dll build 到同一 dll 底下

套件名稱:Fody
用途:像是EEP server因為只吃自己server的dll  所以要全部綁在一起才能參考到

2017年12月26日 星期二

2017年12月15日 星期五

JQuery Validate Remote

http://www.cc.ntu.edu.tw/chinese/epaper/0033/20150620_3307.html

https://jqueryvalidation.org/remote-method/

自訂驗證方式主要是用ajax打後端取得驗證結果

範例如下:
        var validator = $form.validate({
            rules: {
                //定義驗證規則,其中屬性名為表單的name屬性
                'ApplicationContentViewModel.CellPhoneNumber': {
                    required: true,
                    remote: {
                        url: '/RentalApplication/CheckCellPhoneNumber',
                        type: 'POST',
                        dateType: 'json',
                        data: {
                            mobileType: function () {
                                setFilterData();
                                return filterData.MobileType;
                            },
                            cellPhoneNumber: function () {
                                return $('#ApplicationContentViewModel_CellPhoneNumber').val();
                            }
                        }
                    }
                }
            },
            messages: {
                'ApplicationContentViewModel.CellPhoneNumber': {
                    remote: "該郵箱已存在!"
                }
            }
        });