2012年4月16日 星期一

【ASP.NET 3.5】GridView 欄位 檢查

一、GridView1_RowUpdating

if(string.IsNullOrEmpty((string)e.NewValues[0])) {

                sScript = "alert('欄位不得為空值');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "error", sScript, true);
                e.Cancel = true; //取消更新

}

二、SqlDataSource1_Updating

            string sScript;
            if (String.IsNullOrEmpty(e.Command.Parameters["@NAL_BCP_M"].Value.ToString()))
            {
                sScript = "alert('欄位不得為空值');";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "error", sScript, true);
                e.Cancel = true; //取消更新
            }

【螢火蟲】苗栗 三義 不遠山莊

苗栗 三義 不遠山莊

2012年4月15日 星期日

【VS 2008】快速鍵 功能

Ctrl+E+S 程式碼 空白鍵 (出現一點一點)
Ctrl+E+C 註解 //
Ctrl+E+U 取消 註解 //
Ctrl+X 剪下
Ctrl+V 貼上

Ctrl+E+D 程式碼 自動重新整理 編排


F7 檢視程式碼
F7+Shift 檢視設計頁面
CTRL+L 刪除游標所在的那一行
CTRL+K CTRL+F 將選取範圍的程式碼自動排版