网站重构和vs2010.ppt
网站重构和VS2010,网站重构 VS2005常用控件的用法,网站重构,重要性 示例,通过DIV+CSS实现,VS2005常用控件的用法,MD5加密 Button Grid View * Data List Reapter Dropdown list * Report Viewer *,MD5加密,不可逆性 所属命名空间 使用示例:,System.Web.Security,Web.Security.sAuthentication .HashPasswordForStoringInConfigFile(“abc“, “md5“),Grid View,数据邦定,Dim conn As New SqlConnection(Connstr) Dim adp As New SqlDataAdapter(sql, conn) Dim ds As New DataSet() conn.Open() adp.Fill(ds, tab) dl.DataSource = ds dl.DataBind(),Grid View,格式化绑定中的数据字段,在RowDataBound中对数据行绑定进行修改 If e.Row.RowType = DataControlRowType.DataRow Then Dim rd As Integer rd = Integer.Parse(DataBinder.(e.Row.DataItem, “book_read“)) e.Row.Cells(1).Text End If,Grid View,分页,If GridView1.PageIndex < GridView1.PageCount - 1 Then GridView1.PageIndex = GridView1.PageIndex + 1 fill_gd(GridView1, “select * from book“, “book“) End If,Data List 和Reapter,示例,Dropdown list,数据绑定,dl.Items.Clear() dl.DataSource = ds dl.DataTextField = filedname dl.DataValueField = filedvalue dl.DataBind() dl.Items.Add(ls) dl.SelectedValue = 0,注意:回传时要将AutoPostBack设为True,否则传不回来选顶的值,