上一页 1 ··· 20 21 22 23 24
摘要: listview控件如图:本实例主要展示了listview控件的ItemCreated事件,ItemUpdating事件,前者主要是发生在databound事件之前改变页面的内容,itemupdating事件只要是用来设置更新数据时的事件。本例结合杨中科老师讲解的dropdownlist和listview控件来展开的,希望能给自己和大家带来启示!!using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.Web. 阅读全文
posted @ 2011-06-20 21:36 haiziguo 阅读(342) 评论(0) 推荐(0) 编辑
摘要: ItemDataBound主要是用来最后改变一次repeat在客户端加载的数据主要用来设置 ItemCommand主要是利用repeat的按钮控件的CommandName和CommandArgument1.ItemCommand实例 protected void Repeater3_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "启用")//CommandName主要使前台代码和后台代码打交道 { T_UsersTableAdapter adapter = new 阅读全文
posted @ 2011-06-10 02:06 haiziguo 阅读(443) 评论(0) 推荐(0) 编辑
摘要: 定义数据集就是把表拉到.xsd的界面的名称如图(http://hi.csdn.net/attachment/201106/9/0_13076420264QqD.gif )T_UsersTableAdapter adapter = new T_UsersTableAdapter();记得添加引用类型; 阅读全文
posted @ 2011-06-10 01:55 haiziguo 阅读(366) 评论(0) 推荐(0) 编辑
摘要: [引用:地址不明确了!]--不足:23山东和16山东重复--创建DBPromary数据库 create database DBPromaryuse DBPromarygo--创建promary表create table promary(proID int primary key,proName varchar(50) not null)----------------------------------------------------------------------------------------------------------------------------------- 阅读全文
posted @ 2011-05-31 23:20 haiziguo 阅读(387) 评论(0) 推荐(0) 编辑
摘要: 首先启动一个RowDataBound控件里面在加上一个if ((e.Row.Cells[0].Text).Length > 6){e.Row.Cells[0].Text = (e.Row.Cells[0].Text).Substring(0, 6) + "…";//截取文章主题}//如果是第一列的话用cell【0】 if ((e.Row.Cells[1].Text).Length > 6) { e.Row.Cells[1].Text = (e.Row.Cells[1].Text).Substring(0, 6) + "…";//截取文章内容 阅读全文
posted @ 2010-12-27 12:17 haiziguo 阅读(281) 评论(0) 推荐(0) 编辑
摘要: 有很多时间在想怎么删除gridview的行下面就简单介绍献丑一下我是怎么用的<asp:TemplateField><ItemTemplate><asp:Button runat="server" CommandName="Delete" OnClientClick="return confirm('您确认要删除吗?')" Text="删除" /></ItemTemplate></asp:TemplateField>再加上RowDeletin 阅读全文
posted @ 2010-12-27 12:09 haiziguo 阅读(173) 评论(0) 推荐(0) 编辑
摘要: HyperLink传递一个值很好说,但是传递两个值是怎么传的呢?<asp:DataList ID="DataList1" runat="server" Width="250px" RepeatColumns="2" RepeatDirection="Horizontal"> <ItemTemplate> <table> <tr> <td colspan="2" style="text-align: center& 阅读全文
posted @ 2010-12-27 11:57 haiziguo 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 框架页<iframe src="left.aspx" scrolling="no" name="left" style=" height: 900px; width:150px;" ></iframe> <iframe src="newsList.aspx" scrolling="yes" name="main" style="height: 900px; width:550px" id="IFR 阅读全文
posted @ 2010-12-27 11:46 haiziguo 阅读(450) 评论(0) 推荐(0) 编辑
摘要: 今天用了一个用户自定义控件,作为搜索控件,用到的是一个textbox和一个button,protected void btn_search_Click(object sender, EventArgs e) { Response.Redirect("~/search.aspx?item='" + this.RadioButtonList1.Text.ToString() +" '&content='" + this.txt_content.Text.ToString().Trim() +"'") 阅读全文
posted @ 2010-12-27 11:39 haiziguo 阅读(206) 评论(0) 推荐(0) 编辑
摘要: private void hsgupload() { if (this.FileUpload1.HasFile) { string fname; string nam = FileUpload1.FileName; //取得文件名(抱括路径)里最后一个"."的索引 int i = nam.LastIndexOf("."); //取得文件扩展名 string newext = nam.Substring(i); //这里我自动根据日期和文件大小不同为文件命名,确保文件名不重复 //DateTime now = DateTime.Now; //string 阅读全文
posted @ 2010-12-27 11:23 haiziguo 阅读(1005) 评论(0) 推荐(0) 编辑
上一页 1 ··· 20 21 22 23 24