ASP NET 3 5 Ch 9 ASP NET
- Slides: 26
ASP. NET 3. 5 Ch 9 ASP. NET網頁資料庫
ADO. NET存取資料庫 Data. Reader Command Web Form控制項 (資料繫結) Connection Data. Set 資料來源 Data. Table
Sql. Data. Source資料來源控制項: ch 9 -4 -1 n n n Protected Sub Button 1_Click(By. Val sender As Object, By. Val e As System. Event. Args) If lst. Names. Selected. Index > -1 Then lbl. Output. Text = lst. Names. Selected. Item. Value End If End Sub
利用Grid. View瀏覽資料: ch 9 -4 -3 n n n 新增Grid. View物件 新增Sql. Data. Source物件 設定Sql. Data. Source屬性: 選擇資料庫 2. 設定Select陳敘句 SELECT * FROM [Books] WHERE ([Book. Price] >= @Book. Price) 3. Data. Source. Mode=Data. Reader 1.
結合Drop. Down. List與Grid. View瀏覽 選擇資料-Ch 9 -4 -4 1. 2. 3. 4. 5. 新增Sql. Data. Source 1,並僅抓出書籍分類 新增Drop. Down. List 1,其資料來源來自 Sql. Data. Source 1 新增Sql. Data. Source 2,並設定Book. Catalog等 於’Control’中的Drop. Down. List 1 新增Grid. View 1,資料來源來自 Sql. Data. Source 2 注意Auto. Post. Back的問題
結合Drop. Down. List與Grid. View瀏覽 選擇資料-Ch 9 -4 -4
存取Cookie的方式 n Response. Cookies(“變數名稱”). Value=變數值 Response. Cookies(“變數名稱 ”). Expires=Now. Adddays(天數) Cookie若不設到期日,在瀏覽器關閉後刪除 讀取: Request. Cookies(“變數名稱”). Value n If Not Request. Cookies(“變數名稱”) Is Nothing then n
範例: n n n n Protected Sub Page_Load(By. Val sender As Object, By. Val e As System. Event. Args) If Request. Cookies("Last. Visited") Is Nothing Then '讀不到 Cookie 表示是第一次連線到這個網站 Label 1. Text = "您是第一次拜訪本站" Else '讀取 Cookie 值, 將到訪的時間顯示於 Label 1. Text = "您上次到訪本站的時間為: " & Request. Cookies("Last. Visited"). Value End If n n n '將現在時間紀錄於名為 Last. Visited 的 Cookie Response. Cookies("Last. Visited"). Value = Now Response. Cookies("Last. Visited"). Expires = Now. Add. Days(30) End Sub
- Classic asp to asp.net migration
- Output cache in mvc
- Who is this
- Asp.net soap
- Feature flag meaning
- Inurl:bug bounty intext:token of appreciation
- Authentication filters in mvc 5
- Asp net core future
- Asp.net server controls
- Crud asp.net c# web forms
- Session tracking in asp.net
- Asp net core future
- Tutorialspoint dotnet
- 大阪 microsoft asp.net
- Asp net session state
- Asp net load testing
- Introduction to asp.net
- Asp.net execution model
- 大阪 microsoft asp.net
- Agenda en asp.net
- Desarrollo de aplicaciones web con asp.net
- Web development timeline
- Asp.net web api 2
- Aspx xss bypass
- Custom controls in asp.net
- Asp.net agenda
- Reflection in asp net