return RedirectToAction("action", "controller", new { area = "area" });
- 10月 07 週一 201313:28
[mvc] RedirectToAction 到其他area的view
- 10月 07 週一 201313:25
[jquery] Loading JSON objects using JSONP
/* Loading JSON objects using JSONP */
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.1.min.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.1.1.min.js"></script>
- 10月 07 週一 201313:22
[.net] Array.Exists 判斷
bool a = Array.Exists(array, element => element == "perls");
- 10月 07 週一 201313:20
[linq] linq get first
var fp = lnq.attaches.Where(a => a.sysid == sysid)
.Select(a => a.name)
.First();
.Select(a => a.name)
.First();
- 10月 07 週一 201313:17
[JQuery] check box 控制 submit
$('input[type="checkbox"]').click(function() {
if($(this).is(':checked') == true) {
$('input[type="submit"]').removeAttr('disabled');
} else {
$('input[type="submit"]').attr('disabled','disabled');
}
});
if($(this).is(':checked') == true) {
$('input[type="submit"]').removeAttr('disabled');
} else {
$('input[type="submit"]').attr('disabled','disabled');
}
});
- 12月 27 週四 201215:39
[SQL] 和今天的比較
WHERE datediff( d,getdate(),my_date) > 0 -- 取得my_date是今天以後的資料
WHERE datediff( d,my_date,getdate()) = 1 -- 取得my_date是昨天的資料
- 12月 04 週二 201214:58
[SQL] WHERE條件中的if判斷
需要在sql的where條件子句中過濾特定的條件判斷
例如:輸入空白時,該欄位將不進行條件的判斷
以下的例子,想找出在台灣的某都市中,該區的一些資訊
如果區的條件輸入空白時則略過該條件判斷
- 10月 19 週五 201216:47
[mvc] 將break line自動換成html的換行
當資料從Controller傳送到View時,將跳行符號轉成Html的< br />
資料來源 : 物件的屬性 或 要顯示的資料
- 10月 18 週四 201214:01
[JQuery] datetimepicker驗證
1:Jquery的datetimepicker如果要將顯示出來的日期格式及輸入驗證改成 yyyy-mm-dd時
例如 2012-10-11 ,請加入 dateFormat: 'yy-mm-dd'
2:在關閉datetiepicker UI時再次驗證是否輸入正確
請利用 onClose: function() {$(this).valid();}
$(function () {
$("#time_begin_d,#time_end_d").datepicker({
dateFormat: 'yy-mm-dd',
onClose: function() {$(this).valid();}
});
});
- 6月 15 週五 201216:45
[mvc4] DropDownListFor 的應用
專案:mvc4
動機:登錄畫面上新增學歷的DropDownList
1.建立學歷的models
public class EduDegree
{
public string degree_no { get; set; }
public string name { get; set; }
}
