- 博客(11)
- 资源 (1)
- 收藏
- 关注
原创 web_在webconfig中写连接字符串
using System.Configuration; string con=ConfigurationSettings.AppSettings["dsn"]+System.Web.HttpContext.Current.Server.MapPath(ConfigurationSettings.AppSettings["filepath"]);OleDbCon
2006-12-12 10:47:00
617
原创 web_利用GridView更新数据
public void dataBd() { OleDbDataAdapter da = new OleDbDataAdapter("select * from xxb",conn); conn.Open(); da.Fill(ds,"xxb"); conn.Close(); GridView1.DataS
2006-12-12 10:46:00
1629
原创 web_去掉MagicAjax中的loading标志
最近,用了一下MagicAjax 觉得不错,使用很简单,经验终结如下: 1、打开vs 添加 MagicAjax.dll,就会有AjaxPanel 控件,就往上拖东西吧。(简单吧!) 2、打开web.config 添加: ...
2006-12-12 10:46:00
721
原创 web_GridView编辑时不变列宽
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { gg.Attributes.Add("style", "table-layout:fixed"); bindGg(); }
2006-12-12 10:45:00
910
4
原创 web_GridView链接字段处理
1、在GridView中插入一链接字段2、 3、DataTextField指向数据库中用来在该列显示的字段,DataNavigateUrlFormatString指向点击该字段后将跳向哪一页,{0}指示传递的参数值,其来自当前行中由DataNavigateUrlFields指向的字段值4、在跳转的页中用Request.QueryString["ID"]收集参数,嵌入SQL语句进行查询。
2006-12-12 10:44:00
775
原创 当DataSet为空时也显示GridView的表头
/// /// 当DataSet为空时也显示GridView的表头 /// /// 所要绑定的GridView /// 所要绑定的数据集 /// public void BindNoRecords(GridView gridView, DataSet ds) { if(ds.Tables[0].Rows.Count == 0) {
2006-12-12 10:44:00
671
原创 web_Dropdownlist取出绑定值
1、在pageLoad中读出改变的Dropdownlist的值 s = dp_Subj.SelectedValue.ToString();2、绑定的写法 dp_Subj.DataSource = ds.Tables["课程编码表"].DefaultView; dp_Subj.DataValueField = "课程编号"; dp_Subj.DataTextField = "课程名称";
2006-12-12 10:43:00
578
原创 web_GridView利用内嵌按钮删除记录
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Delete") //判断是哪个按钮 { string id = e.CommandArgument.ToString().Trim()
2006-12-12 10:43:00
572
原创 C#常用函数和方法
1、DateTime 数字型 System.DateTime currentTime=new System.DateTime(); 1.1 取当前年月日时分秒 currentTime=System.DateTime.Now; 1.2 取当前年 int 年=currentTime.Year; 1.3 取当前月 in
2006-12-12 10:42:00
588
原创 KeyUp事件捕获
private void fm_Login_KeyUp(object sender, KeyEventArgs e) { if (e.KeyCode == System.Windows.Forms.Keys.Enter) { bt_Ok_Click(this, null);
2006-12-12 10:42:00
477
原创 asp.net程序中最常用的三十三种编程代码(2.0)
asp.net程序中最常用的三十三种编程代码,为初学者多多积累经验,为高手们归纳总结,看了觉得很有价值~,大家不妨参考下! 1. 打开新的窗口并传送参数: 传送参数: Response.Write("window.open(aaaa.aspx?id=" + this.Button1.Text +")"); 接收参数: string a = Request.QueryS
2006-12-12 10:41:00
929
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人