資料來源:
http://blog.miniasp.com/post/2008/07/20/Fix-IE-PNG-Transparency-Problem-in-IE-5-6.aspx
作者提到三個方法
# Universal transparent-PNG enabler for MSIE/Win 5.5+
# IE PNG Fix v1.0 / 2.0 Alpha 2
# ie7-js
由於專案是新的,故直接使用 ie7-js
http://code.google.com/p/ie7-js/
1.下載後直接將檔案解壓縮後,IE7.js拷貝到目錄
(若不拷貝也可直接引用線上的。)
2.在<head>區塊內增加以下程式碼,視要採用的方式來決定src位置
<!--[if lt IE 7]><script src="src="Scripts\IE7.js"></script>
<![endif]-->
或
<!--[if lt IE 7]><script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE7.js"></script>
<![endif]-->
2011年5月7日 星期六
[ Asp.Net ] CKEditor HTML編輯器
下載位置
http://ckeditor.com/download
傻瓜都會用的步驟說明。
http://docs.cksource.com/CKEditor_3.x/Developers_Guide/ASP.NET/Integration_Beginners
Absolute Beginner's CKEditor for ASP.NET Control Integration Guide
ckeditor的內容讀、寫與插入
引用網址:http://note.tcc.edu.tw/604.html
要操作 ckeditor 的內容,使用 instance 的方法,若textarea 的id="desc"。
讀取內容
var ct= CKEDITOR.instances.desc.getData();
寫入內容
CKEDITOR.instances.desc.setData( "Insert value" ) ;
這裡寫入的內容會注入到原始碼,所有帶有HTML的tags可以生效
取得焦點
CKEDITOR.instances.desc.focus();
插入內容
CKEDITOR.instances.desc.insertHtml( "insert value" ) ;
執行命令
var ct= CKEDITOR.instances.desc;
ct..execCommand('bold');
ct.execCommand('forecolor',false,'#00ff00');
ct.execCommand('JustifyCenter', false, null);
ct.execCommand('fontsize', false, 15);
參考資料
CKEditor 官網 http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html
CKEditor捉取、設定內容 http://www.dotblogs.com.tw/bowwowxx/archive/2010/04/01/14349.aspx 這裡有js的striptags 方法
CKEditor API-Ticket http://dev.ckeditor.com/attachment/ticket/4254/api.html
CKEditor 的插件開發 http://bbish.net/01toturial/44/ckeditor-
微軟的ASP.NET AJAX Control tooklit HTML Editor
http://studyhost.blogspot.com/2010/07/aspnet-ajaxhtml.html
http://ckeditor.com/download
傻瓜都會用的步驟說明。
http://docs.cksource.com/CKEditor_3.x/Developers_Guide/ASP.NET/Integration_Beginners
Absolute Beginner's CKEditor for ASP.NET Control Integration Guide
ckeditor的內容讀、寫與插入
引用網址:http://note.tcc.edu.tw/604.html
要操作 ckeditor 的內容,使用 instance 的方法,若textarea 的id="desc"。
讀取內容
var ct= CKEDITOR.instances.desc.getData();
寫入內容
CKEDITOR.instances.desc.setData( "Insert value" ) ;
這裡寫入的內容會注入到原始碼,所有帶有HTML的tags可以生效
取得焦點
CKEDITOR.instances.desc.focus();
插入內容
CKEDITOR.instances.desc.insertHtml( "insert value" ) ;
執行命令
var ct= CKEDITOR.instances.desc;
ct..execCommand('bold');
ct.execCommand('forecolor',false,'#00ff00');
ct.execCommand('JustifyCenter', false, null);
ct.execCommand('fontsize', false, 15);
參考資料
CKEditor 官網 http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html
CKEditor捉取、設定內容 http://www.dotblogs.com.tw/bowwowxx/archive/2010/04/01/14349.aspx 這裡有js的striptags 方法
CKEditor API-Ticket http://dev.ckeditor.com/attachment/ticket/4254/api.html
CKEditor 的插件開發 http://bbish.net/01toturial/44/ckeditor-
微軟的ASP.NET AJAX Control tooklit HTML Editor
http://studyhost.blogspot.com/2010/07/aspnet-ajaxhtml.html
2011年4月29日 星期五
[Regex] Regex的迷思,完全比對的作法假設
Regex在比對文件內容時,一般都是將符合規則的過濾出來。
但若想要做到完全比對。則必須用一點小技巧。
把待檢測的字串中有符合的規則的字串取代掉,若還有剩下或多餘的字元,就代表有問題。
此可以避免符合規則下的迷思
因一般來說,我們會用isMatch=true 來取得符合規則的部分
但即使規則正確,但並非完全正確的情形卻不可避免
Public gloWUnitPattern As New Regex("臺灣\d{6}公司")
If DetectExtraInformationForRegex(待測字串, gloWUnitPattern規則) <> 0 Then
End If
'偵測符合Regex格式,但仍有多餘的資訊,需列為必改資料!!
' Public Function DetectExtraInformationForRegex(ByVal s As String, ByVal RegexPattern As String) As Integer
Public Function DetectExtraInformationForRegex(ByVal s As String, ByVal rgx As Regex) As Integer
'Dim rgx As New Regex(RegexPattern)
Dim MatchCount As Integer = 0
For Each match As Match In rgx.Matches(s)
s = s.Replace(match.Value, "")
MatchCount += 1
Next
'若沒有成功 就寫入某字串,讓長度不等於0
If MatchCount = 0 Then
s &= "X"
End If
Return s.Length '回傳值 若不為0 就可能有錯誤!
End Function
但若想要做到完全比對。則必須用一點小技巧。
把待檢測的字串中有符合的規則的字串取代掉,若還有剩下或多餘的字元,就代表有問題。
此可以避免符合規則下的迷思
因一般來說,我們會用isMatch=true 來取得符合規則的部分
但即使規則正確,但並非完全正確的情形卻不可避免
Public gloWUnitPattern As New Regex("臺灣\d{6}公司")
If DetectExtraInformationForRegex(待測字串, gloWUnitPattern規則) <> 0 Then
End If
'偵測符合Regex格式,但仍有多餘的資訊,需列為必改資料!!
' Public Function DetectExtraInformationForRegex(ByVal s As String, ByVal RegexPattern As String) As Integer
Public Function DetectExtraInformationForRegex(ByVal s As String, ByVal rgx As Regex) As Integer
'Dim rgx As New Regex(RegexPattern)
Dim MatchCount As Integer = 0
For Each match As Match In rgx.Matches(s)
s = s.Replace(match.Value, "")
MatchCount += 1
Next
'若沒有成功 就寫入某字串,讓長度不等於0
If MatchCount = 0 Then
s &= "X"
End If
Return s.Length '回傳值 若不為0 就可能有錯誤!
End Function
[Asp.net ] 使用AccessDataSource控制項,SQL語法的Rnd亂數無法使用
要使用Rnd() 做隨機文章的效果
SqlCmd = " SELECT TOP 7 * FROM [" & SQLTB & "] WHERE VIS = 1 order by Rnd(" & SortCol & ")
使用AccessDataSource控制項,SQL語法的Rnd亂數無法使用
請改用OleDbConnection OleDbCommand等,就可以正常了
SqlCmd = " SELECT TOP 7 * FROM [" & SQLTB & "] WHERE VIS = 1 order by Rnd(" & SortCol & ")
使用AccessDataSource控制項,SQL語法的Rnd亂數無法使用
請改用OleDbConnection OleDbCommand等,就可以正常了
2011年4月26日 星期二
2011年2月6日 星期日
正確已用外部的js檔案
下面這個無法正常使用
//<script type="javascript" src="Scripts\datetimepicker.js">
下面這個可以正常使用,差別在於 text/javascript
//<script type="text/javascript" src="Scripts\datetimepicker.js">
ps:但有時候會有些例外情形。
//<script type="javascript" src="Scripts\datetimepicker.js">
下面這個可以正常使用,差別在於 text/javascript
//<script type="text/javascript" src="Scripts\datetimepicker.js">
ps:但有時候會有些例外情形。
訂閱:
文章 (Atom)