發表文章

目前顯示的是 10月, 2009的文章

在.cs檔裡動態註冊JavaScript和CSS

//註冊CSS string stylestr = "<style type='text/css'>"; stylestr += ".smallstyle"; stylestr += "{"; stylestr += "font-size: 12px;"; stylestr += "font-family: '新細明體';"; stylestr += "color: Gray;"; stylestr += "}"; stylestr += ".bigbodystyle"; stylestr += "{"; stylestr += "font-size: 20px;"; stylestr += "font-family: '新細明體';"; stylestr += "}"; stylestr += "</style>"; Page.RegisterClientScriptBlock("HideBlock", stylestr);

SQL函數 查詢SQL資料欄位相符的字串

CHARINDEX ( expression1 ,expression2 [ , start_location ] ) 搜尋 expression2 中的 expression1 ,並在找到時傳回它的開始位置。搜尋會在 start_location 開始。 引數 expression1 這是字元 expression ,其中包含要尋找的順序。 expression1 限制為 8000 個字元。 expression2 這是要搜尋的字元運算式。 start_location 這是搜尋開始的整數或 bigint 運算式。如果未指定 start_location ,或者它是負數或 0,搜尋就會從 expression2 開頭開始。

HttpModule與HttpHandler的區別整理

圖片
原本我們在舊版的作業系統上(如XP,Server2003)要讓每個使用者訪問網頁時先進行驗證,判斷是否由外部連結或者是種種的驗證可以直接使用ISAPI來進行(使用C撰寫),但是近年來作業系統的版本已經到了Server2008+,IIS的版本也由原本的IIS6變成了IIS7,因此有些主機在ISAPI的運行變得異常或者是不能執行(但這個問題經過證實是64位元作業系統的問題,變更IIS設定就可以解決這個問題),因此在資料過濾的部份我們除了可以使用ISAPI可以幫我們進行資料過濾,也可運用微軟提供的HttpModule與HttpHandler來處理相同的問題,下面就對者兩者的差異進行說明。

showModalDialog 跳出後背景灰階的語法

圖片
function GridView_OpenDialog2(url, widthpx, heightpx, imgurl) { var dialogcenter = ";dialogTop:" + ((window.screen.height / 2) - (heightpx.replace("px", "") / 2)) + " ; dialogLeft:" + ((window.screen.width / 2) - (widthpx.replace("px", "") / 2)) + ";"; if (imgurl) { var mask = document.createElement("DIV"); mask.id = "GridView_mask"; var style = ""; style += "background-color:white;"; style += "width:100%; height:100%;"; style += "position:fixed; top:0; left:0; zindex:1000;"; style += "filter:alpha(opacity=70); opacity:0.7; zoom:1;-moz-opacity:0.7;"; mask.style.cssText = style; //=======下面這些只有IE支援不建議這樣使用 //mask.style.position = "fixed"; //mask.style.top = 0; //mask.style.left = 0; //mask.style.width = "100%";