MVC5 dropdownlistfor with bootstrap styling - how?
https://www.codeproject.com/Questions/1210667/MVC-dropdownlistfor-with-bootstrap-styling-how
2019年1月17日 星期四
2018年9月19日 星期三
[asp] asp判断session是否存在的四种方法
ASP 判断Session变量是否存在的4种方法
1 If Session("sesName") = "" Then ...2 If Session("sesName") = Empty Then ...
3 If IsEmpty(Session("sesName")) Then ...
4 If Cint(Session("sesName")) = 0 Then ...
2018年6月29日 星期五
[C#]泛型
int Min(int a,int b)
{
if(a<b)
return a;
else
return b;
}
int x=10,y=6;
int t = Min(x,y);
------------------------------------------------------------------
object Min(object a,object b)
{
if(a<b) return a;
else return b;
}
(<)運算 對於泛用的 object型別是無效的,須使用一個共通(或泛用的)介面來做到這一點。
IComparable Min(IComparable a,IComparable b)
{
if(a.CompareTo(b)<0) return a;
else return b;
}
!轉型問題
int x=10,y=6;
int t = (int)Min(x,y);
---------------------------------------------------------------------------------
//泛型(generics)
T Min<T>(T a,T b) where T: ICompareable<T>{
if (a.CompareTo(b)<0) return a;
else return b;
}
int a=5,b=6;
int r = Min<int>(a,b);
可以這樣寫,編譯器可以從參數推測出Min函式T型別的真正型別
int a=5,b=6;
int r = Min(a,b);
{
if(a<b)
return a;
else
return b;
}
int x=10,y=6;
int t = Min(x,y);
------------------------------------------------------------------
object Min(object a,object b)
{
if(a<b) return a;
else return b;
}
(<)運算 對於泛用的 object型別是無效的,須使用一個共通(或泛用的)介面來做到這一點。
IComparable Min(IComparable a,IComparable b)
{
if(a.CompareTo(b)<0) return a;
else return b;
}
!轉型問題
int x=10,y=6;
int t = (int)Min(x,y);
---------------------------------------------------------------------------------
//泛型(generics)
T Min<T>(T a,T b) where T: ICompareable<T>{
if (a.CompareTo(b)<0) return a;
else return b;
}
int a=5,b=6;
int r = Min<int>(a,b);
可以這樣寫,編譯器可以從參數推測出Min函式T型別的真正型別
int a=5,b=6;
int r = Min(a,b);
2018年4月9日 星期一
CS0234: 命名空間 'System' 中沒有類型或命名空間名稱 'Transactions' (您是否遺漏了組件參考?)
https://docs.microsoft.com/zh-tw/dotnet/framework/data/transactions/using-system-transactions-in-aspnet
<system.web>
<compilation>
<assemblies>
<add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
</system.web>
<system.web>
<compilation>
<assemblies>
<add assembly="System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
</system.web>
2018年4月1日 星期日
[ie限制jquery]一行代碼解決各種 IE 兼容問題
x-ua-compatible 頭標籤大小寫不敏感,必須用在 head 中,必須在除 title 外的其他 meta 之前使用。
https://read01.com/zh-tw/KkDzm6.html#.WsGJSi5ubRY
https://read01.com/zh-tw/KkDzm6.html#.WsGJSi5ubRY
2018年2月21日 星期三
2018年2月9日 星期五
利用jquery $.getJSON 於vs時出現HTTP 錯誤 404.3
需在web.config中加入
<system.webServer>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
完整於web.config內容如下
<?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0"/> </system.web> <system.webServer> <staticContent> <mimeMap fileExtension=".json" mimeType="application/json" /> </staticContent> </system.webServer> </configuration>
訂閱:
文章 (Atom)
讓ASP.NET網站在開發除錯時期擁有WEB.CONFIG文件轉換功能
ref: https://blog.kkbruce.net/2016/09/enabling-xml-document-transforms-for-all-asp-net-web-by-develop-time.html#.XoP1KGMzbRY
-
當 IDENTITY_INSERT 設為 OFF 時,無法將外顯值插入資料表 'xx' 的識別資料行中 id 未設定 自動遞增 設定完後 須重新 從資料庫更新模型
-
將不知道的物件反白 按 F1 可以連上MS的MSDN DateTime
-
http://msdn.microsoft.com/en-us/library/ms187752%28v=sql.90%29.aspx
