No Picture
JQuery

[JQuery] Plug-in: Full Calendar

2016-03-18 C.H. Ling 0

寫Application時, 有 user 要求要在calendar中顯示event, 為了極速開發. 找到了個calendar 做參考. Source: http://www.oodlestechnologies.com/blogs/Fullcalendar-Walk-through-with-AngularJS Full Calendar: http://fullcalendar.io/

No Picture
Bootstrap

[Bootstrap] Modal Extension: Bootstrap Dialog

2016-03-16 C.H. Ling 0

有時雖然可以利用modal來做dialog, 但(“#modal”).show() 也須要預設一堆Dialog才可使用. 若只想簡單地做alert(“Hello world”)的話, 可以考慮利用Bootstrap-dialog 這個extension. 網址: https://nakupanda.github.io/bootstrap3-dialog/ Git Project: https://github.com/nakupanda/bootstrap3-dialog

No Picture
ASP.net MVC

[ASP.net MVC] 如何自建User control

2016-03-16 C.H. Ling 0

在建構框架 (framework)時, 會有機會須要重覆使用一堆指定的 user control. 其實透過 extend HtmlHelper, 便可以將coding變得簡單, 將來修改時亦只須要修改一部份便可. 在這裡, 用了一個Bootstrap control 做例子. public static class HtmlHelperExtend { public static MvcHtmlString DateTimePicker(this HtmlHelper helper, string divDayTimePickerId, string txtBoxdayTimePickerId, DateTime? value, string labelId, string labelText=”Label […]

No Picture
JavaScript

[JavaScript] 如何配合JQuery做到Async submit

2016-03-16 C.H. Ling 0

在此例子中, 它override了本身form[0].submit()的方法, 再配合JQuery ajax(), 從而做到到async submit 的效果. $(‘#formDetails’).submit(function (e) { e.preventDefault(); //do some verification $.ajax({ url: “@Url.Action(“Save”,”Reservation”)”, method: “POST”, data: $(this).serialize(), success: function (data) { //callback methods go right here } }); });  

No Picture
JavaScript

[JavaScript] Function Parameter 預設值.

2016-03-10 C.H. Ling 0

部份programming language 寫function call 時可以支援default value, 可惜JavaScript不能. 故須要特別處理. function alertDialog(message, title, okCallBack) { message=typeof message !== ‘undefinded’? message: “”; title=typeof title!==’undefinded’? title: “Dialog”; okCallBack=typeof okCallBack!==’undefined’? okCallBack: function (dialogRef) { dialogRef.close(); }; BootstrapDialog.show({ title: title, message: […]

No Picture
ASP.net MVC

[ASP.net MVC] Session Expire Attribute

2016-03-10 C.H. Ling 0

當session timeout時, 若不作處理, 運作時有機會throw exception. 為應對此情況, 可以自訂一個Attribute, 當controller / action call 時, 便會先行attribute. using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace Test.Attributes { public class SessionExpireAttribute : ActionFilterAttribute { public override void […]

1 2