![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ASP.NET
空心
这个作者很懒,什么都没留下…
展开
-
asp.net 删除表格选定记录
★删除表格选定记录 int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex]; string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString() ★删除表格记录警告 private void DataGrid_ItemCre原创 2011-12-29 17:03:46 · 370 阅读 · 0 评论 -
asp.net 对话框
★对话框 private static string ScriptBegin = ""; private static string ScriptEnd = ""; public static void ConfirmMessageBox(string PageTarget,string Content) { string ConfirmContent="var r原创 2011-12-29 17:07:45 · 249 阅读 · 0 评论 -
asp.net 自定义异常处理
★ 自定义异常处理 //自定义异常处理类 using System; using System.Diagnostics; namespace MyAppException { /// /// 从系统异常类ApplicationException继承的应用程序异常处理类。 /// 自动将异常内容记录到Windows NT/2000的应用程序日志 ///原创 2011-12-29 17:06:37 · 530 阅读 · 0 评论 -
asp.net 清空Cookie
★清空Cookie Cookie.Expires=[DateTime]; Response.Cookies("UserName").Expires = 0原创 2011-12-29 17:05:53 · 370 阅读 · 0 评论 -
asp.net 获取错误信息并到指定页面
★获取错误信息并到指定页面 不要使用Response.Redirect,而应该使用Server.Transfer e.g // in global.asax protected void Application_Error(Object sender, EventArgs e) { if (Server.GetLastError() is HttpUnhandledExcep原创 2011-12-29 17:05:24 · 716 阅读 · 0 评论 -
asp.net 格式化
★数字格式化 【的结果是500.0000,怎样格式化为500.00?】 int i=123456; string s=i.ToString("###,###.00"); ★日期格式化 【aspx页面内: 显示为: 2004-8-11 19:44:28 我只想要:2004-8-11 】 应该如何改? 【格式化日期】原创 2011-12-29 17:10:11 · 283 阅读 · 0 评论 -
asp.net 为按钮添加对话框
★为按钮添加对话框 Button1.Attributes.Add("onclick","return confirm('确认?')"); button.attributes.add("onclick","if(confirm('are you sure...?')){return true;}else{return false;}")原创 2011-12-29 17:02:53 · 262 阅读 · 0 评论 -
用Visual C#打造多页面网页浏览器
二、关键技术分析 解决问题的关键在于对浏览器控件WebBrowser的NewWindow2事件的编程。当需要显示某种文件而生成一个新窗口时,NewWindow2 事件即被激活。注意,该事件发生在WebBrowser控件的新窗口产生之前。例如,作为对导航到一个新窗口或者一个脚本控制的window.open方法的响应,即发生该事件。为了声明当一个新窗口被打开时,将使用我们自己的浏览器程序,应原创 2011-12-30 11:49:23 · 570 阅读 · 0 评论 -
asp.net Panel 横向滚动,纵向自动扩展
★Panel 横向滚动,纵向自动扩展 ★回车转换成Tab if(event.keyCode==13 && event.srcElement.type!='button' && event.srcElement.type!='submit' && event.srcElement.type!='reset' && event.srcElement.type!=''&& e原创 2011-12-29 17:12:01 · 626 阅读 · 0 评论 -
asp.net 模板列
★模板列 ' runat="server" width="80%" id="lblColumn" /> 后台代码 protected void CheckAll_CheckedChanged(object sender, System.EventArgs e) { //改变列原创 2011-12-29 17:10:43 · 789 阅读 · 0 评论 -
ASP.NET 常用代码,用session判断是否登陆
★用session判断是否登陆 if(Session["login"] == null) { Response.Redirect("error.aspx"); }原创 2011-12-29 17:02:10 · 291 阅读 · 0 评论 -
asp.net DataGrid2
★DataGrid超级连接列 DataNavigateUrlField="字段名" DataNavigateUrlFormatString="http://xx/inc/delete.aspx?ID={0}"★DataGrid行随鼠标变色 private void DGzf_ItemDataBound(object sender, System.Web.UI.WebCont原创 2011-12-29 17:11:25 · 363 阅读 · 0 评论 -
asp.net 如何设定全局变量
★如何设定全局变量 Global.asax中 Application_Start()事件中 添加Application[属性名] = xxx; 就是你的全局变量 ★怎样作到HyperLinkColumn生成的连接后,点击连接,打开新窗口? HyperLinkColumn有个属性Target,将器值设置成"_blank"即可.(Target="_blank原创 2011-12-29 17:09:38 · 1780 阅读 · 0 评论 -
asp.net 关于链接
★点击表格行链接另一页 private void grdCustomer_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e){ //点击表格打开 if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType =原创 2011-12-29 17:04:28 · 236 阅读 · 0 评论 -
asp.net datagrid
★读取DataGrid控件TextBox值 foreach(DataGrid dgi in yourDataGrid.Items) { TextBox tb = (TextBox)dgi.FindControl("yourTextBoxId"); tb.Text.... } ★在DataGrid中有3个模板列包含Textbox分别为 DG_ShuLiang (数原创 2011-12-29 17:08:16 · 290 阅读 · 0 评论