Selected Category: ㄝㄟㄙㄆ (5)

View Mode: Post List Post Summary

using Microsoft.Win32;

 

//加密

        private string Encrypt(string Org,string key)

        {

            string res = "";

 

Posted by ikaritw at 痞客邦 PIXNET Comments(0) Trackback(0) Hits(111)

把FileUpload的檔案(圖檔)上傳至MS Sql中,然後從資料庫讀出後,利用ashx的泛型處理轉成二進位位元組,呈現在GridView中。

 


建置:

Create Table UploadImg(

id int identity(1,1),

images image null

)

Posted by ikaritw at 痞客邦 PIXNET Comments(0) Trackback(0) Hits(308)

CalendarS  CalendarS2 

一、新增使用者控制項。

二、處理程式:

三、如要從物件的SelectDates取出日期陣列,要在PagePrerender中取,因為這時候使用者控制項才會有完整的值。

 

 


<%@Control Language="C#" ClassName="CalendarS" %>

Posted by ikaritw at 痞客邦 PIXNET Comments(0) Trackback(0) Hits(223)

今天為了解決掉IE7的網址列的問題,花了一段時間。

在IE7的架構下,如果網站本身沒有加入「信任的網城」的話,會強制出現網址列與狀態列。解決的方式只能請使用者將網站加入信任,不然很多東西都會破功的,所以這只能治標,不能治本。

設定前:

befor_setSafe 

設定:

setSafe 

設定後:

Posted by ikaritw at 痞客邦 PIXNET Comments(0) Trackback(0) Hits(290)

原來

readonly有這麼神奇卻又除不出錯的功效。

TextBox 如果把 ReadOnly 屬性設定為 True,透過 JavaScript 設定的值,在 ASP.NET 2.0 是無法取到值的!
 

解決之道:

  1. 利用 Request 來取值。
  2. 如果非要使用 textBox.Text 來取值的話,textBox. ReadOnly 記的還是設為 false 
  3. 但是在 Page_Load,加入
  • textBox1.Attributes.Add("ReadOnly", "ReadOnly") 
  • textBox1.Attributes("ReadOnly")= "ReadOnly" 
  • textBox1.Attributes("ReadOnly")= "True"

Posted by ikaritw at 痞客邦 PIXNET Comments(1) Trackback(0) Hits(376)