untitled

Similar documents
untitled

untitled

untitled

untitled

untitled

untitled

IsPostBack 2

untitled

Microsoft PowerPoint - ch2.ppt

untitled

untitled

第一章 導論

PowerPoint 簡報

untitled

untitled

untitled

投影片 1

朝 陽 科 技 大 學

個人教室 / 網路硬碟

九十三年第三期檔案管理工作研習營學員建議事項答覆情形彙整表

untitled

Powerpoint 2003

untitled

龍華科技大學

untitled

人身保險業務員資格測驗方案

隱形眼鏡的世界

untitled

untitled

untitled

untitled

untitled

untitled

台灣經濟新報資料庫

untitled

untitled

中華人民共和國殘疾人保障法(2008年修訂)

第五章 實例個案

untitled

untitled

1

untitled

untitled

untitled

I/O Files讀寫檔案:

untitled

untitled

untitled

untitled

臺灣地區的警察教育現況與展望

untitled

untitled

大陸黨報集團化發展之研究

untitled

untitled

untitled

untitled

4-04 論文封面(樣式)

untitled

中華民國第45屆中小學科學展覽會

國立中山大學學位論文典藏.PDF

untitled

行政院國科會九十一年度專題研究

錄 錄 參 益 金流量 陸 說 理 說 易 六 諾 說 - 2 -

untitled

台南縣全民學區數位學習課程進階班—PhotoImpact 10

untitled

untitled

了 立 連 立 量 領 來 例 蘭 便 不 數 不 論 更 更 更 力 更 參 例 來 例 見 量 度 量 量 參 論 量 行 量 量 瑩 理 來 錄 量 量 不 力 省 力 立 力 量 量 量 了 量 便 錄 錄 錄 料 說 省 6

untitled

untitled

untitled

untitled

untitled

untitled

勞工安全衛生組織管理及自動檢查辦法修正條文對照表(草案)

untitled

untitled

性別主流化簡介

untitled

第一章 簡介

untitled

專 題 論 述

untitled


untitled

untitled

九十一年度九年一貫課程國中藝術與人文領域召集人研習班

untitled

施政計畫管理資訊系統

廉 樂 不 廉 倫 理 廉 倫 理 領 不 參 領 不 若 不 不 不 不 利 聯 行 李 聯 例 律

untitled

untitled

1-2岁宝宝的游戏和活动指南

逢甲大學

國立故宮博物院九十三年提升服務品質績效報告

untitled

第三章 我國非營業特種基金制度及運作現況

untitled

untitled

Transcription:

1

LinkButton LinkButton 連 Button Text Visible Click

HyperLink HyperLink 來 立 連 Text ImageUrl ( ) NavigateUrl 連 Target 連 _blank _parent frameset _search _self 連 _top

例 sample2-a1 易 連 private void Page_Load(object sender, System.EventArgs e) { yahoohl.navigateurl = "http://tw.yahoo.com"; yahoohl.target = "_blank"; }

Image Image 來 ImageUrl AlternateText Height Width Height Width

練 sample2-b1 念 利 ImageUrl 來更 Image

ImageButton ImageButton Button ImageUrl AlternateText Click ( 理 參數 滑 )

例 sample2-a2 (1) 利 onmouseover onmouseout HTML <asp:imagebutton onmouseover="this.src='carlogo.jpg' " onmouseout="this.src='cartext.jpg' "

例 sample2-a2 (2) WebForm1.aspx private void carib_click(object sender, System.Web.UI.ImageClickEventArgs e) { if(e.x<=100) textlb.text = " 來 BMW!!"; else textlb.text = " 來 BENZ!!"; }

練 sample2-b2 念 數 Label Label Visible false 數 Cookie Session

DropDownList DropDownList 拉 Items 拉 (items ListItemCollection 類 ) ( ListItem 類 ) AutoPostBack 更 SelectedIndexChanged 更 ( AutoPostBack true)

ListItemCollection 類 DropDownList items ListItemCollection 類 () 索 ex DropDownList1.Items[1] Count ListItem 數 SelectedItem SelectedIndex 索 Add (ListItem string) Clear Remove (ListItem string) RemoveAt 索 (int)

ListItem 類 ListItemCollection 類 ListItem 類 Text Value 聯 Selected

例 sample2-a3 (1) struct star { public string name; public string country; public string imgurl; }

例 sample2-a3 (2) star[] mystar = new star[3]; private void Page_Load(object sender, System.EventArgs e) { mystar[0].name = "S.H.E"; mystar[0].country = ""; mystar[0].imgurl = "she.jpg"; mystar[1].name = " "; mystar[1].country = ""; mystar[1].imgurl = ".jpg";

例 sample2-a3 (3) mystar[2].name = " "; mystar[2].country = " "; mystar[2].imgurl = ".jpg"; } if(!ispostback) { foreach(star staritem in mystar) starddl.items.add(staritem.name); starddl.autopostback = true; changeinfo(); }

例 sample2-a3 (4) private void starddl_selectedindexchanged(object sender, System.EventArgs e) { changeinfo(); } private void changeinfo() { namelb.text = mystar[starddl.selectedindex].name; countrylb.text = mystar[starddl.selectedindex].country; pictureimg.imageurl = mystar[starddl.selectedindex].imgurl; }

ListBox ListBox DropDownList Items ( ListItemCollection 類 ) SelectionMode Single Multiple ( 利 Selected true)

例 sample2-a4 (1) private void purchasebtn_click(object sender, System.EventArgs e) { shoppinglb.items.add(itemlb.selecteditem); itemlb.items.remove(itemlb.selecteditem); shoppinglb.selectedindex = -1; totallb.text = total().tostring(); }

例 sample2-a4 (2) private void cancelbtn_click(object sender, System.EventArgs e) { itemlb.items.add(shoppinglb.selecteditem); shoppinglb.items.remove(shoppinglb.selecteditem); itemlb.selectedindex = -1; totallb.text = total().tostring(); }

例 sample2-a4 (3) private int total() { int sum = 0; foreach(listitem item in shoppinglb.items) { sum += int.parse(item.value); } return sum; }

練 sample2-b3 類 拉 說 神 龍 C# JAVA 料 料理 料理 料理

CheckBox CheckBox Text TextAlign Checked CheckedChanged 狀 ( AutoPostBack true)

CheckBoxList CheckBoxList Items ( ListItemCollection 類 ) RepeatColumns 料欄 數 RepeatDirection SelectedIndexChanged 更 ( AutoPostBack true)

RadioButton RadioButton Text TextAlign Checked GroupName CheckedChanged 狀 ( AutoPostBack true)

RadioButtonList RadioButton 來 立 Items ( ListItemCollection 類 ) RepeatColumns 料欄 數 RepeatDirection SelectedIndexChanged 更 ( AutoPostBack true)

例 sample2-a5 (1) 料 WebForm1.aspx private void submitbtn_click(object sender, System.EventArgs e) { Session.Add("name",nameTB.Text); Session.Add("sex",sex1RB.Checked?"":""); Session.Add("education", educationrbl.selecteditem.text);

例 sample2-a5 (2) WebForm1.aspx string hobby = ""; foreach(listitem item in hobbycbl.items) if(item.selected) hobby+= item.text +" "; if(hobby == "") hobby = " "; Session.Add("hobby", hobby); } Response.Redirect("WebForm2.aspx");

例 sample2-a5 (3) WebForm2.aspx private void Page_Load(object sender, System.EventArgs e) { Response.Write(Session["name"].ToString()); Response.Write(Session["sex"].ToString() + "!!<br>"); Response.Write(" 歷 "+Session["education"].ToString() + "<br>"); Response.Write(" "+Session["hobby"].ToString()); }

練 sample2-b4 念 ListItem Value

Access 料 (1) 立 料 [] [] [ 料 ]

立 料 Access 料 (2) 料 [ 立 料 ]

Access 料 (3) 料 料 料 料 料 料 欄

ADO.NET ADO.NET.NET Framework 類 來 料 料 料 料 料 Ex MSSQL Access Excel XML ADO.NET 連

.NET 料.NET 料 料來 類.NET Data Provider SQL.NET Data Provider System.Data.SqlClient 料 MS-SQL OLE DB.NET Data Provider System.Data.OleDb 料 Dbase FoxPro Excel Access Oracle Access ODBC.NET Data Provider 料 MySQL

DataAdapter DataAdapter 料來 DataSet Fill 料來 料 料 Update 更 料來 料

利 DataAdapter 立連 (1) 料類 類 拉 DataAdapter 精靈

利 DataAdapter 立連 (2) 連 來 立連

利 DataAdapter 立連 (3) ACCESS 料 Microsoft Jet 4.0 OLE DB Provider

利 DataAdapter 立連 (4) 連 料來 連

利 DataAdapter 立連 (5) 連 連 錄

利 DataAdapter 立連 (6) SQL

利 DataAdapter 立連 (7) SQL 來 行 SQL

利 DataAdapter 立連 (8) 料

利 DataAdapter 立連 (9) 欄 SQL

利 DataAdapter 立連 (10) DataAdapter

利 DataAdapter 立連 (11) DataAdapter 立 DataSet ( 料 )

利 DataAdapter 立連 (12) DataSet ( 料 ) 利 DataAdapter Fill DataSet

DataGrid (1) DataGrid 料 料 DataSource 料來 AutoGenerateColumns 料欄 Columns 欄 DataBind 行 料

DataGrid (2) DataSet 料 DataGrid DataSource DataSet 利 DataAdapter Fill 料來 料 DataSet 利 DataGrid DataBind 行 料

例 sample2-a6 料 DataGrid private void Page_Load(object sender, System.EventArgs e) { oledbdataadapter1.fill(dataset11); DataGrid1.DataBind(); }

練 sample2-b5 料 立 料 欄 料 DataGrid 念 利 DataAdapter 立 連

料行類 料行 料來 欄 料行 立 理 料 連 料行 料行 連 料行 利 來

料行 料行 來 料來 欄 料 DataGrid 欄 料欄 料來 欄

料行 料行 更 ( ) 欄 料 () SelectedIndexChanged 狀 利 SelectedItem 料列

DataGrid 料 DataGrid 料 Items Cells 來 Items DataGrid 料列 Cells 料列 列 欄 料 DataGrid1.Items[1].Cells[3].Text;

例 sample2-a7 DataGrid 金 private void Page_Load(object sender, System.EventArgs e) { oledbdataadapter1.fill(dataset11); DataGrid1.DataBind(); int total = 0; foreach(datagriditem item in DataGrid1.Items) total += int.parse(item.cells[1].text); totallb.text = total.tostring(); }

練 sample2-b6 料 立 料 數 欄 欄 列 料 念 利 料行來 料 AutoGenerateColumns false

連 料行 連 料行 料行 連 ( ) 欄 料 () URL 欄 連 URL 串 列參數 若 URL WebForm2.aspx?filename={0} URL 欄 料 {0}

例 sample2-a8 private void Page_Load(object sender, System.EventArgs e) { oledbdataadapter1.fill(dataset11); favoritedg.databind(); }

練 sample2-b7 料 立 料 欄 連 料行 連 WebForm2.aspx 列 念 URL 串 URL 欄 料 列參數

料行 料行 ( ) 欄 料 () 令 行 令 (CommandName) 料行 ItemCommand ItemCommand 料列 參數 e DataGrid 料行 令 來 EnableViewState false

例 sample2-a9 private void Page_Load(object sender, System.EventArgs e) { oledbdataadapter1.fill(dataset11); itemdg.databind(); } private void itemdg_itemcommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { shoppinglb.items.add(e.item.cells[1].text+ " " +e.item.cells[2].text); totallb.text = (int.parse(totallb.text) + int.parse(e.item.cells[2].text)).tostring(); }

練 sample2-b8 料 立 料 金 欄 sample2-a9 念 利 CommandName 來 Items FindByText

DataGrid 料 數 利 來 料 利 (AllowPaging) true (PageSize) 料 數 利 PageIndexChanged 參數 e NewPageIndex DataGrid CurrentPageIndex 行

練 sample2-b9 料 立 料 欄 料 利 料 料 念 利 PageIndexChanged 參數來 DataGrid CurrentPageIndex