随笔分类 -  asp.net

everything about asp.net
摘要:前一阵做一个项目,在处理报表的时候时间偏长,客户提出要做出一个等待窗口提示用户等待(页面太久没反映,用户还以为死了呢)。在分析这一需求之后,觉得如果要实现像winform应用中的processbar太困难了。最后,只好模拟,做了一个“假”的等待窗体,还好客户也挺满意。 这个等待窗体实际上是利用了 一开始是隐藏起来的。当点击处理按钮之后,就将它显示出来: 最后给处理按... 阅读全文
posted @ 2007-12-19 12:52 Fernando
摘要:TABLE自动换行: 数字和英文的时候,TABLE中的TD就会被拉长,不会自动换行了。全角的时候是可以的。 解决方法是 添加 用表格做网页排版的时候,一般都能正常使用。偏偏有时会碰到一段连续的英文词或者一堆感叹号(!!!)把网页就撑开的现象:( 总结了一下,只要在CSS中定义了如下句子,可保网页不会再被撑开了。 table{table-layout: fixed;} td(word-bre... 阅读全文
posted @ 2007-12-07 10:56 Fernando
摘要:ItemDataBound,ItemCreated的发生时间 ItemDataBound嘛,只要执行了DataBind方法,就会马上激发这个事件。 ItemCreated呢,如果页面是第一次访问 (Page.IsPostBack = false),那在第一次执行DataBind的时候,会先激发ItemCreated事件,也就是说,执行了DataBind后,首先会用 ItemCreated来建立H... 阅读全文
posted @ 2007-12-07 09:45 Fernando
摘要:datalist的实现 protected int i = 0; protected void DataList1_ItemDataBound(object sender, DataListItemEventArgs e) { i++; if (i / 10 == 1) { e.Item.Contro... 阅读全文
posted @ 2007-12-06 15:10 Fernando
摘要:cs: using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; usi... 阅读全文
posted @ 2007-12-06 10:22 Fernando
摘要:GridViewCommandEventArgs 类未包含一个用于指示单击按钮所在行的属性。如果需要知道哪个行引发了事件,请使用 CommandArgument 属性将行的索引传给事件处理方法。 所以你要先在RowCreated(其中Test是按钮的CommandName) protected void GridView1_RowCreated(object sender, GridViewRo... 阅读全文
posted @ 2007-12-03 13:15 Fernando
摘要:HyperLink lnk = GridView1.Rows[e.RowIndex].FindControl("MyHyperLinkID") as HyperLink; string url = lnk.NavigateUrl; // ... 阅读全文
posted @ 2007-11-27 13:40 Fernando
摘要:在一个用户查询页面有三个查询分别查询全部用户,按名称模糊查询用户和按照角色查询用户。这三个功能需要调用业务端三个不同的函数,它们的返回值一样,都是数据对象集合SESGMemberShipUserCollection 使用GridView1来显示查询结果,ObjectDataSource1是数据源。问题是如何能够在程序的运行时设置让ObjectDataSource1动态调用业务端的三个方法。 解决方... 阅读全文
posted @ 2007-11-27 13:39 Fernando
摘要:protected void Page_Load(object sender, EventArgs e) { if (DataList1.Items.Count == 0) { LabelMessage.Text = "No Records"; LabelMessage.Visible = true; ... 阅读全文
posted @ 2007-11-26 17:56 Fernando
摘要:' Visible=''> 阅读全文
posted @ 2007-11-26 17:30 Fernando
摘要:前台添加一模版列,里面添加一个Button 后台 protected void gv_Company_RowCo... 阅读全文
posted @ 2007-11-22 18:47 Fernando
摘要:Download Demo Project - 80 Kb Introduction The Calendar control becomes an essential control for business application developments since the most of data entry forms used to have one or more fi... 阅读全文
posted @ 2007-11-22 12:48 Fernando
摘要:HttpContext.Current.Request.Url.ToString() 并不可靠。 如果当前URL为 http://localhost/search.aspx?user=http://csharp.xdowns.com&tag=%BC%BC%CA%F5 通过HttpContext.Current.Request.Url.ToString()获取到的却是 http://lo... 阅读全文
posted @ 2007-11-19 18:04 Fernando
摘要:在使用FormView或则DetailsView时,经常会遇到记录为空的情况,那这时如果能改为插入模式,用户体验会非常的好。 1. 把DetailsView的默认模式改为Insert模式; 2. 加入以下代码: //当GridView中的行被选中后,使DetailsView改为ReadOnly模式 protected void GridView1_SelectedIndexChan... 阅读全文
posted @ 2007-11-02 15:28 Fernando
摘要:Page 执行中将按照如下顺序激活事件: Page.PreInit Page.Init Page.InitComplite Page.PreLoad Page.Load Page.LoadComplete Page.PreRender Page.PreRenderComplete 如果页面从令一个页面继承,如BasePage:System.Web.UI.Page,在BasePage中做了一些扩... 阅读全文
posted @ 2007-11-02 14:54 Fernando
摘要://删除店铺之前,先把相关的分类数据从数据库中删除 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { int dietStoreID = Convert.ToInt32(e.Keys[0]); DietStoreClassDetai... 阅读全文
posted @ 2007-11-02 11:46 Fernando
摘要:将Button控件的CausesValidation属性设置为False即可. 阅读全文
posted @ 2007-11-01 16:27 Fernando
摘要:vb: int(request.querystring("serial")) c#: convert.int32(request.querystring["serial"]) 阅读全文
posted @ 2007-10-31 16:43 Fernando
摘要:在formview里面放3个联动到dropdownlist到时候会出现这样到错误信息。 查找了中文博客,没有任何到解释,终于在找国外资料到时候找到了这个问题到完全解决方案,非常到不错。 Demo for 2-way databinding cascading lists within a FormView You might have wanted to use inside a databou... 阅读全文
posted @ 2007-10-31 15:44 Fernando