搜尋此網誌

2015年4月25日 星期六

DotNetNuke 安裝記錄 2015-04-25


2014年12月9日 星期二


2014年8月6日 星期三

PrintDocument.PrinterSettings.Copies 設定列印份數作法

如果只用 PrintDocument.PrinterSettings.Copies 是無作用的, 經try過多次各種作法後, 以下的作法可達到目的:

Step 1.宣告一個列印份數的全域變數

Step 2.PrintDocument 會依 PrinterSettings.Copies的值決定呼叫這個Handler的次數.
在 PrintDocument 的 PrintPage event handler 中, 在每次被呼叫時, PrintCopies 扣掉 1, 若還未印完(PrintCopies > 0),
e.HasMorePages 設為 True, 若不去設它, 它的預設值會是 False, 那麼不管你指定多少份也只會列一份.


Step 3.Print button 的 Click event handler 中呼叫 PrintDocument 的 Print() method 開始列印


2013年3月9日 星期六

jQuery Show HTML 內容

問題:
如下圖, 直接資料庫中的內容~




解法:
把內容profile.PropertyValue 加工如下





結果:


2013年3月2日 星期六

DotNetNuke Get Role Groups

DotNetNuke 判斷使用者是否有 Module 的 Edit Permission

重點如下:
1.ModuleController
2.GetModule 取得 ModuleInfo object
3.DotNetNuke.Security.Permissions.ModulePermissionController.HasModuleAccess
4.SecurityAccessLevel.Edit

DotNetNuke log4net 使用方法

DotNetNuke 6.0 以後開始內建 log4net, 使用方法非常簡單

使用方法如下:

1.加入參考


2.開始寫Log


3.查看Log內容


4.Log 設定檔 DotNetNuke.log4net.config


2013年2月12日 星期二

2013年2月9日 星期六

Team Foundation Server Express 2012 安裝使用記錄

Step 1.下載網站
http://www.microsoft.com/visualstudio/cht/downloads
要下載2個安裝程式:
1.Visual Studio Team Foundation Server Express 2012
   (免費版TFS, 可供5人以下Team使用)
2.Visual Studio Express 2012 for Web
  (內含新版Team Explorer, 可供設定TFS)

Step 2.安裝SQL Server 2008 R2 Express
一定要安裝成Default Instance(MSSQLServer), TFS 才認得

Step 3.安裝TFS Express
無法安裝在Server 2003, 只好裝在Windows 8上


Step 4.Configuration / Start Wizard

Step 5.建立Team Project
   必須在Visual Studio Express 2012中才可操作

Step 6.將小組成員加入到專案

Step 7.從Visual Studio 2010連到TFS 2012 Express

2013年1月18日 星期五

Stored Procedure INSERT 前先判斷是否已存在, 若存在則 UPDATE


CREATE PROC DNNIT_FAQ_UpdateSetting

@ModuleId int,
@Setting varchar(50),
@Value int

AS

DECLARE @Id int

SELECT @Id = SettingId FROM DNNIT_FAQ_Settings WHERE ModuleId = @ModuleId AND Setting = @Setting

IF(@Id IS NOT NULL)
   UPDATE DNNIT_FAQ_Settings
   SET
      Value = @Value
   WHERE
      SettingId = @Id
ELSE
   INSERT INTO DNNIT_FAQ_Settings
   (
 ModuleId, Setting, Value
   )
   VALUES
   (
 @ModuleId, @Setting, @Value
   )

2013年1月17日 星期四

jQuery $.post return value failed 無法取得回傳值問題處理

在使用$.post function 刪除某個分類時, 想要先判斷分類下有無資料, 若有, 則不可刪除
若把判斷回傳值的程式碼寫在call back function 中會發生回傳值為空值的狀況, 造成無法判斷,
使用以下寫法即可:

重點: 使用sync方式取得回傳值, 再回復async方式作判斷及進行刪除動作

2013年1月15日 星期二

Dictionary Usage

Namespace:
System.Collections.Generic

Assembly:
mscorlib

格式:
Dictionary<TKey, TValue> 

Represents a collection of keys and values.

實作範例:






2013年1月12日 星期六

jQuery 中使用 ASP.NET RadioButton Server Control

1.取得選取的 button (get selected button)
有以下新增popup window, 欲取得 Is Enabled 的值:


jQuery 寫法可取得選取的值並透過 ajax post 到 server

2013年1月10日 星期四

CommandTimeout 用法

using(SqlConnection conn = new SqlConnection(strConn))
{
     string strSQL = "select * from users";
     SqlCommand cmd = new SqlCommand(strSQL, conn);
     cmd.CommandTimeout = 0;
     conn.Open();
     SqlDataReader reader = cmd.ExecuteReader();
     while(reader.Read())
     {
         ....
     }
     reader.Close();
}

gRaphaël’s


JavaScript 圖表函式庫
gRaphaël’s goal is to help you create stunning charts on your website. It is based on Raphaël graphics library. Check out the demos to see static and interactive charts in action.
gRaphaël currently supports Firefox 3.0+, Safari 3.0+, Opera 9.5+ and Internet Explorer 6.0+.


hkSilicon 網站介紹

CSS button generator 按鈕線上產生器

相關網站: