tag:blogger.com,1999:blog-140346952024-02-20T18:51:28.381-08:00Tony Li's BlogTony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.comBlogger65125tag:blogger.com,1999:blog-14034695.post-80295704288450595672020-03-06T08:58:00.002-08:002020-03-06T09:00:32.724-08:00Bootstrap 3 Prevent or Disable Closing Bootstrap ModalUse HTML<br />
<br />
<div class="crayon-line" id="crayon-5e62534d73d47813063968-1" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span><span class="crayon-e" style="box-sizing: inherit; color: rgb(0 , 78 , 208); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">button </span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">type</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"button"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">id</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"MybtnPreventHTML"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-t" style="box-sizing: inherit; color: rgb(128 , 0 , 128); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">class</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"btn btn-primary"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">data</span>-<span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">target</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"#MymodalPreventHTML"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">data</span>-<span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">toggle</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"modal"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">data</span>-<span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">backdrop</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"static"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">data</span>-<span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">keyboard</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"false"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span><span class="crayon-e" style="box-sizing: inherit; color: rgb(0 , 78 , 208); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">Open </span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">Modal</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span>/<span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">button</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-2" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span><span class="crayon-sy" style="box-sizing: inherit; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">!</span>--<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-sy" style="box-sizing: inherit; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">.</span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">modal</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span>--<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-3" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span><span class="crayon-e" style="box-sizing: inherit; color: rgb(0 , 78 , 208); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">div </span><span class="crayon-t" style="box-sizing: inherit; color: rgb(128 , 0 , 128); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">class</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"modal fade"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">id</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"MymodalPreventHTML"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-4" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span><span class="crayon-e" style="box-sizing: inherit; color: rgb(0 , 78 , 208); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">div </span><span class="crayon-t" style="box-sizing: inherit; color: rgb(128 , 0 , 128); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">class</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"modal-dialog"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-5" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span><span class="crayon-e" style="box-sizing: inherit; color: rgb(0 , 78 , 208); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">div </span><span class="crayon-t" style="box-sizing: inherit; color: rgb(128 , 0 , 128); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">class</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"modal-content"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-6" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span><span class="crayon-e" style="box-sizing: inherit; color: rgb(0 , 78 , 208); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">div </span><span class="crayon-t" style="box-sizing: inherit; color: rgb(128 , 0 , 128); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">class</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"modal-header"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-7" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span><span class="crayon-e" style="box-sizing: inherit; color: rgb(0 , 78 , 208); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">button </span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">type</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"button"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-t" style="box-sizing: inherit; color: rgb(128 , 0 , 128); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">class</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"close"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">data</span>-<span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">dismiss</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"modal"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span><span class="crayon-sy" style="box-sizing: inherit; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">×</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span>/<span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">button</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-8" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span><span class="crayon-e" style="box-sizing: inherit; color: rgb(0 , 78 , 208); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">h4 </span><span class="crayon-t" style="box-sizing: inherit; color: rgb(128 , 0 , 128); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">class</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"modal-title"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">Notification</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span>/<span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">h4</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-9" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span>/<span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">div</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-10" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span><span class="crayon-e" style="box-sizing: inherit; color: rgb(0 , 78 , 208); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">div </span><span class="crayon-t" style="box-sizing: inherit; color: rgb(128 , 0 , 128); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">class</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"modal-body"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-11" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-e" style="box-sizing: inherit; color: rgb(0 , 78 , 208); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">Are </span><span class="crayon-e" style="box-sizing: inherit; color: rgb(0 , 78 , 208); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">you </span><span class="crayon-e" style="box-sizing: inherit; color: rgb(0 , 78 , 208); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">sure </span><span class="crayon-e" style="box-sizing: inherit; color: rgb(0 , 78 , 208); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">you </span><span class="crayon-e" style="box-sizing: inherit; color: rgb(0 , 78 , 208); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">want </span><span class="crayon-st" style="box-sizing: inherit; color: rgb(128 , 0 , 128); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">to</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-st" style="box-sizing: inherit; color: rgb(128 , 0 , 128); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">continue</span><span class="crayon-sy" style="box-sizing: inherit; color: rgb(51 , 51 , 51); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">?</span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-12" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span>/<span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">div</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-13" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span><span class="crayon-e" style="box-sizing: inherit; color: rgb(0 , 78 , 208); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">div </span><span class="crayon-t" style="box-sizing: inherit; color: rgb(128 , 0 , 128); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">class</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"modal-footer"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-14" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span><span class="crayon-e" style="box-sizing: inherit; color: rgb(0 , 78 , 208); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">button </span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">type</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"button"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-t" style="box-sizing: inherit; color: rgb(128 , 0 , 128); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">class</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"btn btn-default"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">data</span>-<span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">dismiss</span>=<span class="crayon-s" style="box-sizing: inherit; color: rgb(0 , 128 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">"modal"</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">Close</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span>/<span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">button</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-15" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span>/<span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">div</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-16" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span>/<span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">div</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-17" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span>/<span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">div</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"> </span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-18" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><</span>/<span class="crayon-i" style="box-sizing: inherit; font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">div</span><span class="crayon-h" style="box-sizing: inherit; color: rgb(0 , 111 , 224); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;">></span></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-18" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<br /></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-18" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
Use Jquery</div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-18" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<br /></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-18" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<br /></div>
<div class="crayon-line" id="crayon-5e62534d73d47813063968-18" style="background: 0px center rgb(253, 253, 253); border: 0px; box-sizing: inherit; font-family: Arial, sans-serif; font-size: 16px; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; white-space: pre;">
<table class="crayon-table" style="background-attachment: initial !important; background-clip: initial !important; background-image: none !important; background-origin: initial !important; background-position: initial !important; background-repeat: initial !important; background-size: initial !important; border-collapse: collapse !important; border-spacing: 0px !important; border: none !important; box-sizing: inherit; color: #6f6f6f; font-size: 12px; margin-bottom: 0px !important; margin-left: -29px; margin-right: 0px !important; margin-top: 0px !important; padding: 0px !important; table-layout: auto !important; width: auto !important;"><tbody style="box-sizing: inherit;">
<tr class="crayon-row" style="background: 0px center; border: none !important; box-sizing: inherit; margin: 0px !important; padding: 0px !important; vertical-align: top !important;"><td class="crayon-nums " data-settings="hide" style="background: rgb(223, 239, 255) !important; border: 0px; box-sizing: inherit; color: rgb(84, 153, 222) !important; margin: 0px !important; padding: 0px !important; vertical-align: top !important; word-break: normal;"><div class="crayon-nums-content" style="background: 0px center; border: 0px; box-sizing: inherit; font-size: 16px !important; line-height: 20px !important; margin: 0px; padding: 0px; white-space: nowrap;">
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-2" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
2</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-3" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
3</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-4" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
4</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-5" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
5</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-6" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
6</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-7" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
7</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-8" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
8</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-9" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
9</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-10" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
10</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-11" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
11</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-12" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
12</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-13" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
13</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-14" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
14</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-15" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
15</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-16" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
16</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-17" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
17</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-18" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
18</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-19" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
19</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-20" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
20</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-21" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
21</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-22" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
22</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-23" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
23</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-24" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
24</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-25" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
25</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-26" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
26</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-27" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
27</div>
<div class="crayon-num" data-line="crayon-5e62534d73d3c640732251-28" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px; text-align: center;">
28</div>
</div>
</td><td class="crayon-code" style="background: 0px center; border: 0px; box-sizing: inherit; margin: 0px !important; padding: 0px !important; vertical-align: top !important; width: 841px; word-break: normal;"><div class="crayon-pre" style="background: none !important; border: none !important; box-sizing: inherit; color: black; font-size: 16px !important; line-height: 20px !important; margin: 0px; overflow: visible; padding: 0px; tab-size: 4; white-space: pre;">
<div class="crayon-line" id="crayon-5e62534d73d3c640732251-1" style="background: 0px center; border: 0px; box-sizing: inherit; font-family: inherit; font-size: inherit !important; font-weight: inherit !important; height: inherit; line-height: inherit !important; margin: 0px; padding: 0px 5px;">
<span class="crayon-ta" style="box-sizing: inherit; color: rgb(255 , 0 , 0); font-family: inherit; font-size: inherit; font-weight: inherit; height: inherit; line-height: inherit;"><script></span></div>
<div class="crayon-line" id="crayon-5e62534d73d3c640732251-2" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">
<span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">$</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">(</span><span class="crayon-r" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(128, 0, 128) !important;">document</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">.</span><span class="crayon-e" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 78, 208) !important;">ready</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">(</span><span class="crayon-t" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(128, 0, 128) !important;">function</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">(</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">{</span></div>
<div class="crayon-line" id="crayon-5e62534d73d3c640732251-3" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">
<span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;"> </span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">$</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">(</span><span class="crayon-s" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 128, 0) !important;">'#MybtnModalPrevent'</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">.</span><span class="crayon-e" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 78, 208) !important;">click</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">(</span><span class="crayon-t" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(128, 0, 128) !important;">function</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">(</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">{</span></div>
<div class="crayon-line" id="crayon-5e62534d73d3c640732251-4" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">
<span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;"> </span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">$</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">(</span><span class="crayon-s" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 128, 0) !important;">'#MymodalPrevent'</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">.</span><span class="crayon-e" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 78, 208) !important;">modal</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">(</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">{</span></div>
<div class="crayon-line" id="crayon-5e62534d73d3c640732251-5" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">
<span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;"> </span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">backdrop</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">:</span><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;"> </span><span class="crayon-s" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 128, 0) !important;">'static'</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">,</span></div>
<div class="crayon-line" id="crayon-5e62534d73d3c640732251-6" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">
<span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;"> </span><span class="crayon-i" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">keyboard</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">:</span><span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;"> </span><span class="crayon-t" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(128, 0, 128) !important;">false</span></div>
<div class="crayon-line" id="crayon-5e62534d73d3c640732251-7" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">
<span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;"> </span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">}</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">;</span></div>
<div class="crayon-line" id="crayon-5e62534d73d3c640732251-8" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">
<span class="crayon-h" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(0, 111, 224) !important;"> </span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">}</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">;</span></div>
<div class="crayon-line" id="crayon-5e62534d73d3c640732251-9" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">
<span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">}</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">)</span><span class="crayon-sy" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(51, 51, 51) !important;">;</span></div>
<div class="crayon-line" id="crayon-5e62534d73d3c640732251-10" style="box-sizing: inherit; font-family: inherit; background: 0px center; border: 0px; padding: 0px 5px; margin: 0px; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important;">
<span class="crayon-ta" style="box-sizing: inherit; font-family: inherit; height: inherit; font-size: inherit !important; line-height: inherit !important; font-weight: inherit !important; color: rgb(255, 0, 0) !important;"></script></span></div>
</div>
</td></tr>
</tbody></table>
</div>
Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-41043894511501534372015-08-28T07:11:00.003-07:002015-08-28T07:11:59.486-07:00Recompile the store procedure to improve the performance<div>
One of our report runs under 2min in TEST environment, but over 10 min when deployed in production. After days of research, it turns out all we need to do is to recompile the stored procedure.</div>
<div>
<br /></div>
<div>
Below is from MSDN:</div>
<div>
<br /></div>
When a procedure is compiled for the first time or recompiled, the procedure’s query plan is optimized for the current state of the database and its objects. If a database undergoes significant changes to its data or structure, recompiling a procedure updates and optimizes the procedure’s query plan for those changes. This can improve the procedure’s processing performance.<div>
<br /></div>
<div>
example:<br /><pre style="font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.5499992370605px; overflow: auto; padding: 5px; word-wrap: normal;">USE AdventureWorks2012;
GO
EXEC sp_recompile N'Sales.Customer';
GO</pre>
<pre style="font-family: Consolas, Courier, monospace !important; font-size: 13px; line-height: 17.5499992370605px; overflow: auto; padding: 5px; word-wrap: normal;">
</pre>
<pre style="overflow: auto; padding: 5px; word-wrap: normal;"><span style="font-family: Consolas, Courier, monospace;"><span style="line-height: 17.5499992370605px;">https://msdn.microsoft.com/en-us/library/ms190439.aspx</span></span></pre>
</div>
Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-90083451850108462972015-08-17T07:43:00.000-07:002015-08-17T07:43:46.938-07:00Use camelCasing JSONAdd the following code in the WebApiConfig.cs file in the App_Start folder:<br />
<br />
In the Register static method, add:<br />
<br />
// Web API configuration and services<br />
config.Formatters.JsonFormatter.SerializerSettings.ContractResolver =<br />
new CamelCasePropertyNamesContractResolver();<br />
<br />
reference:<br />
http://odetocode.com/blogs/scott/archive/2013/03/25/asp-net-webapi-tip-3-camelcasing-json.aspxTony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-55813255200896056882015-06-17T13:39:00.000-07:002015-08-17T07:44:10.593-07:00Bootstrap Themeshttp://bootswatch.com/<br />
<br />
https://wrapbootstrap.com<br />
<br />
http://fontawesome.io/Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-85692457110489212932015-06-09T12:13:00.004-07:002015-08-17T07:44:27.643-07:00MVC bootstrap Modal Dialogstarts with: http://www.codeproject.com/Tips/826002/Bootstrap-Modal-Dialog-Loading-Content-from-MVC-Pa<br />
<br />
Replacing Html.BeginForm with Ajax.BeginForm: http://blogs.msmvps.com/craigber/?p=41<br />
<br />
Fix the cache issue with Ajax.BeginForm: http://www.leniel.net/2013/09/detecting-fixing-ajax-beginform-partial-view-stale-data.htmlTony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-459717966563169952015-06-01T09:35:00.001-07:002015-06-01T13:12:46.892-07:00MVC data annotation on Password field Below is the cheat sheet for the password field:<br />
<br />
<br />
<pre style="background-color: #eeeeee; border: 1px dashed #999999; color: black; font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;"> <code style="color: black; word-wrap: normal;">
[Required]
[StringLength(255, MinimumLength=8)]
[DataType(DataType.Password)]
[RegularExpression(@"^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^\da-zA-Z])(.{8,15})$", ErrorMessage = "Password must contain at least 1 number, 1 uppercase letter, and 1 special character.")]
public string Password { get; set; }
</code>
</pre>
<br />
<pre class="prettyprint prettyprinted" style="background: rgb(255, 255, 255); border: 1px solid rgb(225, 226, 226); color: #222222; font-family: Consolas, monospace; font-size: 13.0080003738403px; line-height: 18.2112007141113px; margin-bottom: 30px; margin-top: 18px; outline: 0px; overflow: auto; padding: 5px; vertical-align: baseline;"><span class="pun" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">^</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="com" style="background: transparent; border: 0px; color: green; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">#Beginning of expression</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">(?=.*</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">\d</span><span class="pun" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">)</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="com" style="background: transparent; border: 0px; color: green; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">#At least one digit</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">(?=.*[</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">a</span><span class="pun" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">z</span><span class="pun" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">])</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="com" style="background: transparent; border: 0px; color: green; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">#At least one lower case</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">(?=.*[</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">A</span><span class="pun" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Z</span><span class="pun" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">])</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="com" style="background: transparent; border: 0px; color: green; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">#At least one upper case</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">(?=.*[^</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">\da</span><span class="pun" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">zA</span><span class="pun" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">-</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Z</span><span class="pun" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">])</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="com" style="background: transparent; border: 0px; color: green; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">#A non-alphanumeric character</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
</span><span class="pun" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">(.{</span><span class="lit" style="background: transparent; border: 0px; color: red; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">8</span><span class="pun" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">,</span><span class="lit" style="background: transparent; border: 0px; color: red; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">15</span><span class="pun" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">})</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;"> </span><span class="com" style="background: transparent; border: 0px; color: green; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">#Allow between 8 and 15 characters</span><span class="pln" style="background: transparent; border: 0px; color: black; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
$ </span><span class="com" style="background: transparent; border: 0px; color: green; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">#End of expression</span></pre>
<pre class="prettyprint prettyprinted" style="background: rgb(255, 255, 255); border: 1px solid rgb(225, 226, 226); color: #222222; font-family: Consolas, monospace; font-size: 13.0080003738403px; line-height: 18.2112007141113px; margin-bottom: 30px; margin-top: 18px; outline: 0px; overflow: auto; padding: 5px; vertical-align: baseline;"><span class="com" style="background: transparent; border: 0px; color: green; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">
</span></pre>
<pre class="prettyprint prettyprinted" style="background: rgb(255, 255, 255); border: 1px solid rgb(225, 226, 226); color: #222222; font-family: Consolas, monospace; font-size: 13.0080003738403px; line-height: 18.2112007141113px; margin-bottom: 30px; margin-top: 18px; outline: 0px; overflow: auto; padding: 5px; vertical-align: baseline;"><span class="com" style="background: transparent; border: 0px; font-size: 13.0080003738403px; margin: 0px; outline: 0px; padding: 0px; vertical-align: baseline;">Good website to find a starting point for Regular Expression: <a href="http://regexlib.com/">http://regexlib.com/</a></span></pre>
Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com2tag:blogger.com,1999:blog-14034695.post-64088342596449947152012-03-23T08:38:00.003-07:002012-03-23T08:53:05.580-07:00Increase performance by adding NONCLUSTERED INDEXGot a call from a client reporting an issue that is randomly occurred. after looking into the log file, I found one method took over a min to complete. The code shows only a simple select statement with where clause on "sentby" column. This column is a "nvarchar" and the table itself has over 1 million records.<br /><br />Here is what I learned when I trying to fix this issue:<br /><br />1. use "varchar" instead of "nvarchar". only use "nvarchar" when you have different languages in the same column! if you look at the sql execution plan ( sql -> display estimated ececution plan), search "nvarchar" does an index scan and "varchar" does index seek. index seek is orders of magnitude faster than a scan!<br /><br />2. no index is set on "sentby" column. It won't be an issue in the small table (sql does index scan on small table), but it will impact performance when data grows. I used the script below to add a NONCLUSTERED INDEX on this column.<br /><br />CREATE NONCLUSTERED INDEX IDX_MyMessageTable ON dbo.MyMessageTable<br /> (<br /> SentBy<br /> )<br /><br />after the index is created, the 1 min search time is down to under a second.Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-28054451973766275822012-02-28T11:21:00.003-08:002012-02-28T11:32:47.367-08:00XOOM stuck on dual core logo screen (how to fix)My XOOM was stuck on the Moto dual core logo screen last night. Soft reset (Volumn up + Power) did not work. It reboot, then still stuck on the logo screen. I searched on the web and the popular solution is to reinstall the ROM (requires android SDK and ROM at moto dev site).<br /><br />This is how I fixed my issue without installing the ROM (XOOM wifi only US edition):<br />0. take out the microSD card if you installed one in your XOOM!!!<br />1. reboot (Vol up + Power)<br />2. On start-up when you see the Motorola logo, press and hold the <code>Volume Down</code> key.<br />3. When you see the <code>Android recovery text</code>, press the <code>Volume Up</code> key to put XOOM tablet in recovery mode. After a few min, you should see a Green Android laying down <span class="st">with the triangle and an exclamation (</span>Android recovery screen)<span class="st">.</span><br />4. On the Android recovery screen, press and keep holding the <code>Power</code> button then press and release the <code>Volume Up</code> key. This will take you to the recovery screen with list of menus.<br />5. Using <code>Volume Down</code> key navigate to <code>Wipe data / factory reset</code> option and press <code>Power</code> button to select it.<br />6. Select <code>Yes, delete all user data</code> option using <code>Power</code> button<br />7. My XOOM is fixed this way. time to set up the account again.Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com7tag:blogger.com,1999:blog-14034695.post-44673526376174831332011-09-21T14:48:00.000-07:002011-09-21T14:53:08.491-07:00Prevent asp.net button double clickhttp://www.codeproject.com/KB/ajax/disable_btn_on_click.aspxTony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-56390345074619349362011-08-16T14:32:00.000-07:002011-08-16T14:54:14.687-07:00New Object Oriented Features in C# 3.0<span style="font-weight: bold;">Implicitly Typed Local Variables
<br /></span><code>var age = 30;
<br />
<br /></code><span style="font-weight: bold;" class="clsTitle">Implicitly Typed Arrays</span><code>
<br />var numbers = new[] { 1, 2, 3, 4, 5};
<br />var names = new[] { "Dave", Doug, "Jim" }; </code>
<br />
<br /><span class="clsTitle"><span style="font-weight: bold;">Auto Implemented Properties<span style="font-weight: bold;"><span style="font-weight: bold;">
<br /></span></span></span></span><code>old:
<br />public int ID
<br /> {
<br /> get{return _id;}
<br /> set{_id = value;}
<br /> }</code>
<br />new:
<br /><code>public int ID { get; set; }
<br />
<br /></code><span class="clsTitle"><span style="font-weight: bold;">Object Initializers</span>
<br />old:
<br /></span><code>Person obj = new Person();
<br />obj.ID = 1;
<br />obj.FirstName = "Thiru";
<br />obj.LastName = "Thangarathinam";
<br />new:
<br /></code><code>Person obj = new Person { ID = 1, FirstName = "Thiru", LastName = "Thangarathinam" };
<br />
<br /></code><span style="font-weight: bold;" class="clsTitle">Collection Initializers</span>
<br />old:
<br /><code>List<string> names = new List<string>();
<br />names.Add("David");
<br />names.Add("Tim");
<br />names.Add("Doug");
<br />new:
<br /></string></string></code><code>List<string> names = new List<string> {"David", "Tim", "Doug"};
<br />
<br /></string></string></code><span class="clsTitle"><span style="font-weight: bold;">Anonymous Types</span>
<br /></span><p> As the name suggests, anonymous types allow you to create a type on-the-fly at compile time. The newly created type has public properties and backing fields defined for the members you initialize during construction. For example, consider the following line of code: </p> <p style="background=#EEEEEE;"><code> var obj=new{ID=1,FirstName="Thiru",LastName="Thangarathinam"}; </code></p> <p> In the above line, you just specify the various attributes you want to have in the anonymous class and assign the instantiated object to a variable of type "var". The actual type assigned to obj is determined by the compiler. Since the compiler assigns the name of the type only at compile time, you can't pass an anonymous type to another method and it can only be used within the method they were declared. </p> <p> When the compiler sees the above code, it automatically declares a class as follows: </p> <p style="background=#EEEEEE;"><code> class __Anonymous1
<br />{
<br /> private int _id = 1;
<br /> private string _firstName = "Thiru";
<br /> private string _lastName = "Thangarathinam";
<br />
<br /> public int ID
<br /> {
<br /> get{return _id;}
<br /> set{_id = value;}
<br /> }
<br /> public string FirstName
<br /> {
<br /> get{return _firstName;}
<br /> set{_firstName = value;}
<br /> }
<br /> public string LastName
<br /> {
<br /> get{return _lastName;}
<br /> set{_lastName = value;}
<br /> }
<br />} </code></p> <p> Anonymous Types use the Object Initializer to specify what properties the new type will be declare. This allows us to reduce code looking similar to this: </p> <p> Note that the anonymous types are just meant to be placeholders for quickly defining entity types and you can't add methods or customize the behavior of an anonymous type. </p><span class="clsTitle">
<br /><span style="font-weight: bold;">Extension Methods</span>
<br /></span><p style="font-weight: bold;"> </p><p><span class="clsBlurb"></span></p><p> Another important feature introduced with C# is the ability to add new static methods to existing classes, known as extension methods. Using this new feature, you can extend the built-in classes (such as the String class) to support your custom requirements. For example, you can add a new method named "IsValidZipCode" to the string class that validates the zip code format. Let us discuss the code required to accomplish this: </p> <p style="background=#EEEEEE;"><code> namespace StringExtensions
<br />{
<br /> public static class CustomStringExtension
<br /> {
<br /> public static bool IsValidZipCode(this string input)
<br /> {
<br /> Regex regEx = new Regex(@"^\d{5}$");
<br /> return regEx.IsMatch(input);
<br /> }
<br /> }
<br />} </code></p> <p> As part of the declaring the arguments for the IsValidZipCode, you specify the name of the type to which the extension method should be added as the first parameter. In this case, since we want the IsValidZipCode method to be added to the string class, you specify string as the first parameter. Once you are inside the IsValidZipCode() method, you can access all of the public properties/methods/events of the actual string instance that the method is being called on. In this example, you return true or false depending on whether it is a valid zip code or not. </p> <p> Now that you have implemented the extension method, the next step is to invoke it from the client application. To be able to do that, you first need to import the namespace in which the CustomStringExtension is located. </p> <p style="background=#EEEEEE;"><code> using StringExtensions; </code></p> <p> Once you have imported the namespace, the next step is to declare a variable of type string and invoke the IsValidZipCode() method. </p> <p style="background=#EEEEEE;"><code> private void btnTestExtensionMethod_Click(object sender, EventArgs e)
<br />{
<br /> string zip = "85226";
<br /> if (zip.IsValidZipCode())
<br /> MessageBox.Show("Valid Zipcode format");
<br /> else
<br /> MessageBox.Show("Invalid Zipcode format");
<br />} </code></p> <p> As you can see from the preceding lines of code, the extension methods allow you to write cleaner and easy-to-maintain code. </p> <p> Here are some of the key characteristics of extension methods: </p> <ul><li>The extension method as well as the class that contains the extension method should be static.</li><li>Although extension methods are static methods, they are invoked as if they are instance methods.</li><li>The first parameter passed to the extension method specifies the type on which they operate and it is preceded by the "this" keyword.</li><li>From within the extension method, you can't access the private variables of the type you are extending.</li><li>Instance methods take precedence over extension methods in situations where they have same signature.</li></ul> <p style="font-weight: bold;"> <span class="clsTitle">Lambda Expressions</span> </p>
<br /><p> Anonymous methods is a new feature introduced with C# 2.0 that enables you to declare your method code inline instead of with a delegate function. Let us take a look at a simple anonymous method: </p> <p style="background=#EEEEEE;"><code> public Forms()
<br />{
<br /> check = new CheckBox(...);
<br /> text = new TextBox(...);
<br /> checkBox.CheckedChanged += delegate
<br /> {
<br /> text.Text = "...";
<br /> };
<br />} </code></p> <p> As you can see in the above code, you don't have to explicitly declare a new method to link it with an event. C# 3.0 introduces an even simpler syntax, lambda expressions, which you write as a parameter list followed by the "=>" token, followed by an expression or a statement block. </p> <p> Lambda expressions are simply functions and they are declared in the context of expressions than as a member of a class. It is an inline expression or a statement block which can be used to pass arguments to a method or assign value to delegate. All lambda expressions use the lambda operator => and the left side of the operator denotes the results and the right side contains the expression to be evaluated. For instance, consider the following lambda expression: </p> <p style="background=#EEEEEE;"><code> age => age + 1 </code></p> <p> The above function takes one argument named age, and returns age + 1 as the result. As you can see, Lambda expressions follow the below syntax: </p> <p style="background=#EEEEEE;"><code> (parameter-list) => expression; </code></p> <p> where expression can be any C# expression or a block of code. Just like anonymous methods you can use a lambda expression in place of a delegate. Here are some sample lambda expressions and their corresponding delegates. </p> <p style="background=#EEEEEE;"><code> //Explicitly typed parameter
<br />(Person obj) => MessageBox.Show(obj.FirstName.ToUpper());
<br />
<br />//Implicitly typed parameter
<br />(obj) => obj.FirstName == "Thiru";
<br />
<br />//Explicitly typed parameter
<br />(int a, int b) => a + b
<br />
<br />//Implicitly typed parameter
<br /> (x, y) => { return x + y; } </code></p> <p> As you see from the preceding lines of code, lambda expressions can be written in such a way that it can infer the parameter type from the signature of the delegate it is assigned to. </p>
<br />Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-91411577787713408242011-08-16T12:16:00.000-07:002011-08-16T12:58:34.177-07:00Type Inference<p> To understand type inference, let us look at couple of lines of code. </p> <p style="background=#EEEEEE;"><code> var count = 1;
<br />var output = "This is a string";
<br />var employees = new EmployeesCollection(); </code></p> <p> In the above lines of code, the compiler sees the var keyword, looks at the assignment to count, and determines that it should be an Int32, then assigns 1 to it. When it sees that you assign a string to the output variable, it determines that output should be of type System.String. Same goes for employees collection object. As you would have guessed by now, var is a new keyword introduced in C# 3.0 that has a special meaning. var is used to signal the compiler that you are using the new Local Variable Type Inference feature in C# 3.0. </p> <p> As an example, let us modify our string query example to use the var keyword. </p><pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"><code>
<br />
<br /> string[] names = {"John", "Peter", "Joe", "Patrick", "Donald", "Eric"};
<br /> var namesWithFiveCharacters =
<br /> from name in names
<br /> where name.Length < 5
<br /> select name'
<br /> var lstResults = new List<string>();
<br /> foreach(var name in namesWithFiveCharacters)
<br /> lstResults.Add(name);
<br />
<br /></code></pre>
<br />
<br />As the above code shows, the variable namesWithFiveCharacters now uses the type "var" instead of IEnumerable<string>. Using "var" is much more extensible since it tells the compiler to infer the type from the assignment. In this case, based on the results of the query, which is IEnumerable<string>, the compiler will automatically assume that it is a variable of type IEnumerable<string>.
<br />
<br />If you run the code, it still produces the same output.
<br />(http://www.15seconds.com/issue/060713.htm)
<br /></string></string></string>Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-59972577892309480312011-08-04T15:14:00.001-07:002011-08-04T15:15:31.898-07:00Tethering & Wi-Fi Sharing - Samsung Vibrant<div class="jive-rendered-content"><h2 id="Tethering__WiFi_Sharing">Tethering & Wi-Fi Sharing</h2><p>With Tethering, your phone can share its mobile data connection with a single computer using a USB cable. With Wi-Fi Sharing, your phone can share its mobile data connection with up to five devices wirelessly.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h3>Tether Your Device</h3><p>** Device tethering is <strong>only</strong> available on Devices running 2.2 or higher OS**</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>To tether your device with a computer or other device and use it as a modem, follow these steps:</p><ol start="1"><li>Connect your device to a computer using a USB cable. </li><li>Tap the <strong>Menu</strong> key. </li><li>Tap <strong>Settings</strong>. </li><li>Tap <strong>Wireless & network</strong>. </li><li>Tap <strong>Tethering</strong>. </li><li>Tap <strong>USB tethering</strong>.</li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p> Your device starts sharing its mobile network data connection with your computer or other device via the USB connection. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h3 id="Turn_On_WiFi_Portable_HotSpot">Turn On Wi-Fi Portable HotSpot</h3><p> To turn on Mobile AP, follow these steps: </p><ol start="1"><li>From any Home screen, tap the <strong>Menu</strong> key. </li><li>Tap <strong>Settings</strong>. </li><li>Tap <strong>Wireless & network</strong>. </li><li>Tap <strong>Mobile AP</strong>. </li><li>If prompted, tap Yes.</li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h3 id="Set_up_WiFi_Portable_HotSpot">Set up Wi-Fi Portable HotSpot</h3><p>When you turn on Mobile AP, your device starts broadcasting its Wi-Fi network name (Service Set Identifier) so you can connect to it with up to five computers or other devices. The SSID is a unique key that identifies a wireless Local Area Network (LAN). The purpose of the SSID is to stop other wireless equipment from accessing your LAN — whether accidentally or intentionally. To communicate, wireless devices must be configured with the same SSID. To configure devices with your device’s SSID, follow these steps:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ol start="1"><li>From any Home screen, tap the <strong>Menu</strong> key. </li><li>Tap <strong>Settings</strong>. </li><li>Tap <strong>Wireless & network</strong>. </li><li>Tap <strong>Mobile AP</strong>. </li><li> If desired, tap to edit the <strong>Network SSID</strong>.</li><li>Tap the <strong>Security</strong> drop-down menu.</li><li>Select one of the following options:<ul><li><strong>Open</strong></li><li><strong>WPA2 PSK</strong></li></ul></li><li>Tap <strong>Save</strong>.</li></ol></div>Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-52930815016320448812011-08-03T12:48:00.000-07:002011-08-03T12:50:56.158-07:00Cons of Response.Redirect(url, false)<p>Took me a while to find this redirect issue. Glad I can across this blog from <span class="profile-usercard-hover" userid="b6cdf6d913be44fa93b1519cdc9bf9b0">Jon B. Gallant.</span></p><p>Quote from <span class="profile-usercard-hover" userid="b6cdf6d913be44fa93b1519cdc9bf9b0">Jon B. Gallant</span> http://blogs.msdn.com/b/jongallant/archive/2006/06/20/640484.aspx<br /></p><p>The second parameter overload of Response.Redirect is nice because it doesn't call Response.End, which is responsible for throwing the ThreadAbortException. BUT...</p> <p>The drawback to using this is that the page will continue to process on the server and be sent to the client. If you are doing a redirect in Page_Init (or like) and call Response.Redirect(url, false) the page will only redirect once the current page is done executing. This means that any server side processing you are performing on that page WILL get executed. In most cases, I will take the exception perf hit over the rendering perf hit, esp since the page won't be rendered anyway and that page could potentially have a ton of data. Using <a href="http://www.fiddlertool.com/fiddler/">Fiddler</a> I was also able monitor my http traffic and see that when using this redirect method the page is actually being sent to the client as well.</p> <p>I don't usually do redirects in try/catch blocks, but if you do the ThreadAbortException will be handled by your catch and potentially cause a transaction Abort (depending on what you are doing of course). If you do put the redirect in the try block, then you'll need to explicitly catch the ThreadAbortException or create a wrapper method that does that for you.</p> <p>Something like this would work.</p> <p> </p> <p><span style="font-family:Courier New;font-size:78%;"> <span style="color:#0000ff;">/// </span></span></p><summary><span style="font-family:Courier New;font-size:78%;"><span style="color:#0000ff;"><br /> /// Provides functionality for redirecting http requests.<br /> /// </span></span></summary><span style="font-family:Courier New;font-size:78%;"><span style="color:#0000ff;"><br /> public static class RedirectUtility<br /> {<br /> /// <summary><br /> /// Redirects to the given url and swallows ThreadAbortException that is raised by the Redirect call.<br /> /// </summary><br /> /// <param name="url">The url to redirect to.<br /> public static void Redirect(string url)<br /> {<br /> try<br /> {<br /> HttpContext.Current.Response.Redirect(url, true);<br /> }<br /> catch (ThreadAbortException)<br /> {<br /> }<br /> }<br /> }</span></span><p></p>Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-84607086787584395792009-05-05T11:39:00.001-07:002009-05-05T11:40:38.178-07:00Can't use SCOPE_IDENTITY() to return uniqueidentifier id<span class="searchTerm">SCOPE</span>_<span class="searchTerm">IDENTITY</span>() <span class="searchTerm">returns</span> the last generated *<span class="searchTerm">identity</span>* value in the current <span class="searchTerm">scope</span> (function, stored proc., trigger, etc.). <span class="searchTerm">Identity</span> columns need to be of type bigint, int or smallint and are not compatible with type <span class="searchTerm">uniqueidentifier</span> (i.e. you can't assign an integer to a variable defined as a <span class="searchTerm">uniqueidentifier</span>).<br /><br />So, if you're asking <span class="searchTerm">SQL</span> Server to give you last <span class="searchTerm">identity</span> inserted and then assigning that to a variable previously declared as a <span class="searchTerm">uniqueidentifier</span>, you'll end up with the compatibility error that you're receiving.Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-58629268423676843992009-04-08T15:32:00.000-07:002009-04-08T15:36:06.573-07:00Overloading methods in WCFService oriented development is different than the Object oriented programming. Overloading methods is possible in WCF, but not recommended.<br /><br />To make it work in WCF, you'll need to add Name property<br /><br /><pre class="coloredcode">[<span class="typ">ServiceContract</span>]<br /><span class="kwd">public</span> <span class="kwd">interface</span> <span class="typ">ICalendarService</span><br />{<br /> [<span class="typ">OperationContract</span>(Name = <span class="st">"GetScheduledEventsByDate"</span>)]<br /> <span class="typ">ScheduledEvent</span>[] GetScheduledEvents(<span class="typ">DateTime</span> date);<br /><br /> [<span class="typ">OperationContract</span>(Name = <span class="st">"GetScheduledEventsByDateRange"</span>)]<br /> <span class="typ">ScheduledEvent</span>[] GetScheduledEvents(<span class="typ">DateTime</span> start, <span class="typ">DateTime</span> end);<br />}<br /><br />For more info: <a href="http://jeffbarnes.net/portal/blogs/jeff_barnes/archive/2006/09/20/Overloading-Methods-in-WCF.aspx">here</a><br /></pre>Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-39649879096146066422009-04-08T15:27:00.000-07:002015-06-01T08:57:29.502-07:00SQL: Return limit RowsIn the asp.net application, i found the good way to return limit rows from data table is to use the ROWCOUNT<br />
<br />
<pre>CREATE PROCEDURE GetContacts
(
@ModuleID int,
@maxrows int = 0
)
AS
SET ROWCOUNT @maxrows
SELECT
ItemID,
CreatedDate,
CreatedByUser,
Name,
Role,
Email,
Contact1,
Contact2
FROM
Contacts
WHERE
ModuleID = @ModuleID</pre>
For more info: http://authors.aspalliance.com/stevesmith/articles/sprowcount.aspTony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-72168461696148146722009-04-01T12:04:00.000-07:002009-04-01T12:06:40.614-07:00Change the author initial when review comments<ol><li>On the <b class="ui">Review</b> tab, in the <b class="ui">Tracking</b> group, click the arrow next to <b class="ui">Track Changes</b>, and then click <b class="ui">Change User Name</b>.</li><li>Click <b class="ui">Popular</b>.</li><li>Under <b class="ui">Personalize your copy of Office</b>, change the name or initials that you want to use in your own comments.</li></ol>Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-51024090535287139222009-03-12T14:50:00.000-07:002009-04-01T12:04:24.637-07:00FxCop: exclude the naming rule for some wordsI used the Iframe identifier in my project and FxCop did not like it.<br /><br />The way to get around this without rename everywhere is to include a custom dictionary named CustomDictionary.xml in the project directory.<br /><dictionary><words><recognized><word></word></recognized></words></dictionary><br /><br />for more info: http://msdn.microsoft.com/en-us/bb264492.aspxTony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-54222382740765858772009-03-06T15:43:00.000-08:002009-03-06T15:48:43.774-08:00FxCop to Excluded in SourceThere are 2 ways to make the rule exceptions in FxCop. One way is to update the .fxcop file. Another way is to update your source code.<br /><br /><br />For Excluded in Source, add add the following line on top of the method/function/data members.<br /><br />[SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Need to set Specialties collection")]<br /><br />Also, need to declare System.Diagnostics.CodeAnalysis in your source file.<br /><br />using System.Diagnostics.CodeAnalysis;Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-73555441147959971012009-01-28T13:56:00.000-08:002009-01-28T14:02:47.492-08:00StringComparisonHere is a great article on when to use the StringComparison.<br /><br />http://msdn.microsoft.com/en-us/library/ms973919.aspx<br /><br /><span style="font-weight:bold;">DO: Use StringComparison.Ordinal or OrdinalIgnoreCase for comparisons as your safe default for culture-agnostic string matching.</span><br /><br /><span style="font-weight:bold;">DO: Use StringComparison.Ordinal and OrdinalIgnoreCase comparisons for increased speed.</span><br /><br />DO: Use StringComparison.CurrentCulture-based string operations when displaying the output to the user.<br /><br />DO: Switch current use of string operations based on the invariant culture to use the non-linguistic StringComparison.Ordinal or StringComparison.OrdinalIgnoreCase when the comparison is linguistically irrelevant (symbolic, for example).<br /><br />DO: Use ToUpperInvariant rather than ToLowerInvariant when normalizing strings for comparison.<br /><br />DON'T: Use overloads for string operations that don't explicitly or implicitly specify the string comparison mechanism.<br /><br />DON'T: Use StringComparison.InvariantCulture-based string operations in most cases; one of the few exceptions would be persisting linguistically meaningful but culturally-agnostic data.Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-87688500481771924422009-01-22T15:31:00.000-08:002009-01-22T15:41:43.000-08:00Use delegate to sort the generic list (collection)Here is an example of how to use the delegate to sort the list:<br /><br />returnList.Sort(delegate(IMyClass x, IMyClass y)<br />{<br /> return String.Compare(x.Name, y.Name);<br />});<br /><br />So, instead of override the ICompare, you can use this short-cut to return a sorted list.<br /><br />Here is how to just make your Thing class implement IComparable<Thing>, implementing the CompareTo method like this:<br /><br />public int CompareTo(Thing other)<br />{<br /> return Name.CompareTo(other.Name);<br />}Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-17023094724200444492008-12-08T11:21:00.000-08:002008-12-08T11:23:58.417-08:00Format data in gridviewTo format the date and time, use DataFormatString="{0:MM/dd/yyyy hh:mm tt}"<br /><br />d = day of month without leading zero<br />M = month without leading zero<br />yyyy = year as four digits<br />h = hours in 12 hour format without leading zero<br />mm = minutes with leading zero<br />tt = two character am/pm designaror<br /><br />To format the "%", use DataFormatString="{0:0%}"<br /><br />To format the currency "$xx.xx", use DataFormatString="{0:C}"Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-44236185872509073452008-12-02T15:04:00.001-08:002008-12-03T07:36:32.970-08:00Validate image size, type, and dimensionWhen upload images to file server or database, most likely we'll put some restrictions on the size, dimensions, and type of image.<br /><br />In my asp.net project, I used the custom validator to accomplish this goal. In the validator function, we can check the size, dimension, and type. Make sure to use Page.IsValid in order to show the error messages.<br /><br /><pre style="font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%"><code> protected void valImage_ServerValidate(object source, ServerValidateEventArgs args)<br /> {<br /> int maxSize = 1024 * 1024;<br /> int maxWidth = 350;<br /> int maxHeight = 225;<br /><br /> if (args.IsValid)<br /> {<br /> if (FileUploadImage.PostedFile.ContentLength > maxSize)<br /> {<br /> args.IsValid = false;<br /> CustomValidatorFile.ErrorMessage = "The image file size must be less than 1 MB.";<br /> }<br /> else if (FileUploadImage.PostedFile.ContentType != "image/jpeg" &&<br /> FileUploadImage.PostedFile.ContentType != "image/pjpeg")<br /> {<br /> args.IsValid = false;<br /> CustomValidatorFile.ErrorMessage = "The image file type must be jpeg.";<br /> }<br /> else <br /> {<br /> GetNewImage(); //put image stream in the session state;<br /> using (Bitmap bitmap = new Bitmap(FileUploadImage.PostedFile.InputStream, false))<br /> {<br /> if (bitmap.Width > maxWidth || bitmap.Height > maxHeight)<br /> {<br /> args.IsValid = false;<br /> CustomValidatorFile.ErrorMessage = "The image dimension must be less than 225px in height and 300px in width.";<br /> }<br /> }<br /> }<br /> }<br /> }<br /></code></pre><br /><br />reference: http://aspalliance.com/781_CodeSnip_Validate_Image_Size_Dimension_and_Type_Uploads;<br />http://www.mikeborozdin.com/post/ASPNET-Image-Uploading-(part-I).aspxTony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-56533014169929849202008-11-21T06:55:00.000-08:002008-11-21T06:59:53.126-08:00Centering: Auto-width MarginsBy <span style="font-weight: bold;">setting its right and left margin widths to "auto"</span>, it will make the content box horizontally centered. This is the preferred way to accomplish horizontal centering with CSS, and works very well in most browsers with CSS2 support.<br /><br />Unfortunately, IE5/Win does not respond to this method. The workaround is to set the text-align to center.<br /><br />Margin example:<br /><br /><p>h1 {margin: 10px}<br /> all four margins will be 10px</p> <p>h1 {margin: 10px 2%}<br /> top and bottom margin will be 10px, left and right margin will be 2% of the total width of the document.</p> <p>h1 {margin: 10px 2% -10px}<br /> top margin will be 10px, left and right margin will be 2% of the total width of the document, bottom margin will be -10px</p> <p>h1 {margin: 10px 2% -10px auto}<br /> top margin will be 10px, right margin will be 2% of the total width of the document, bottom margin will be -10px, left margin will be set by the browser</p>Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0tag:blogger.com,1999:blog-14034695.post-26343875419820476352008-11-13T12:50:00.000-08:002008-11-13T12:53:01.620-08:00Host File<span style="font-family:Arial, Helvetica, sans-serif;font-size:100%;">The short answer is that the Hosts file is like an address book. When you type an address like www.yahoo.com into your browser, the Hosts file is consulted to see if you have the IP address, or "telephone number," for that site. If you do, then your computer will "call it" and the site will open. If not, your computer will ask your ISP's (internet service provider) computer for the phone number before it can "call" that site. Most of the time, you do not have addresses in your "address book," because you have not put any there. Therefore, most of the time your computer asks for the IP address from your ISP to find sites.<br /><br /></span><span style="font-family:Arial, Helvetica, sans-serif;font-size:100%;"><i>Windows NT/2000/XP Pro</i> c:\winnt\system32\drivers\etc\hosts </span><br /><span style="font-family:Arial, Helvetica, sans-serif;font-size:100%;"><br />For more info, go to <a href="http://accs-net.com/hosts/what_is_hosts.html">HERE</a><br /></span>Tony Li - .NET Developerhttp://www.blogger.com/profile/13001033227986403577noreply@blogger.com0