loadin Do…

一条只能往前走的路,叫时光.

首页 联系 订阅 管理
 1. 打开新的窗口并传送参数:
Title  传送参数:
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>")
接收参数:
string a = Request.QueryString("id");
string b = Request.QueryString("id1");

2.为按钮添加对话框

TitleButton1.Attributes.Add("onclick","return confirm(’确认?’)");
button.attributes.add("onclick","if(confirm(’are you sure...?’)){return true;}else{return false;}")

3.表格点击改变颜色
Titleif (e.Item.ItemType == ListItemType.Item e.Item.ItemType == ListItemType.AlternatingItem)
{
 e.Item.Attributes.Add("onclick","this.style.backgroundColor=’#99cc00’;
    this.style.color=’buttontext’;this.style.cursor=’default’;");
}

4.获取错误信息并到指定页面
Title不要使用Response.Redirect,而应该使用Server.Transfer

e.g

// in global.asax
protected void Application_Error(Object sender, EventArgs e) {
if (Server.GetLastError() is HttpUnhandledException)
Server.Transfer("MyErrorPage.aspx");

//其余的非HttpUnhandledException异常交给ASP.NET自己处理就okay了 :)
}


5.Panel 横向滚动,纵向自动扩展

<asp:panel style="overflow-x:scroll;overflow-y:auto;"></asp:panel>
posted on 2006-12-13 22:41  i'am sl  阅读(155)  评论(0)    收藏  举报