文章分类 -  asp.net

js正则表达式限制文本框只能输入数字,小数点,英文字母,汉字等各类代码
摘要:1.用户名只允许为英文,数字和汉字的混合var reg = /^(\w|[\u4E00-\u9FA5])*$/; if(arr=username.match(reg)) { ti=1; return ture; } else { alert("用户名只允许为英文,数字和汉字的混合,\n请检查是否前后有空格或者其他符号"); ti=0; return false; } 2.利用正则表达式限制网页表单里的文本框输入内容: 用正则表达式限制只能输入中文:onkeyup="value=value.replace(/[^\u4E00-\u9FA5] /g,'' 阅读全文

posted @ 2012-07-16 15:48 NewProgramer

使用上下键切换TextBox控件
摘要:private void FCSSNCL_KeyDown(object sender, KeyEventArgs e) { ALLMYCLASS cctemp = new ALLMYCLASS(); switch (e.KeyCode) { case Keys.Up: { int i = this.ActiveControl.TabIndex; cctemp... 阅读全文

posted @ 2012-05-22 09:03 NewProgramer

C# winForm里窗体嵌套
摘要:ShowAllPage sAllPage = new ShowAllPage(); sAllPage.FormBorderStyle = FormBorderStyle.None; sAllPage.Dock = DockStyle.Fill; sAllPage.TopLevel = false; this.MainPanel.Controls.Clear(); this.MainPanel.Controls.Add(sAllPage); sAllPage.Show();MainPanel为主窗体中的Panel控件,ShowAllPage为要在主窗体中显示中Panel中的窗体. 阅读全文

posted @ 2012-05-21 15:49 NewProgramer

Sys.WebForms.PageRequestManagerTimeoutException - The server request timed out - error
摘要:Last week I had a problem when I tried to export an image from the AGS 9.2 to a pdf file. I got this error: "Sys.WebForms.PageRequestManagerTimeoutException The server request timed out" from the Ajax Extension framework. Its occurred because the export operation was relatively long (somet 阅读全文

posted @ 2012-05-17 09:23 NewProgramer

C#中获取应用程序路径的方法(集合)
摘要:string str1 =Process.GetCurrentProcess().MainModule.FileName;//可获得当前执行的exe的文件名。 string str2=Environment.CurrentDirectory;//获取和设置当前目录(即该进程从中启动的目录)的完全限定路径。 //备注 按照定义,如果该进程在本地或网络驱动器的根目录中启动,则此属性的值为驱动器名称后跟一个尾部反斜杠(如“C:\”)。如果该进程在子目录中启 动,则此属性的值为不带尾部反斜杠的驱动器和子目录路径(如“C:\mySubDirectory”)。string str3=Directory.G 阅读全文

posted @ 2012-04-19 14:49 NewProgramer

RDLC报表合并列问题处理
摘要:之前负责的一个项目 C# winform 客户端连 J2EE 应用,其中 C# 客户端报表使用的是 RDLC 报表,最近用户反映 RDLC 报表导出 Excel 时会产生莫名其妙的列合并问题,为此抽取了点时间仔细看了下 RDLC 报表,并对其莫名其妙的列合并问题给出了解决方案。1、 问题描述 图 1 RDLC 设计器界面 图 2 RDLC 报表填充数据后的运行界面 图 3 导出 Excel 出现的合并列情况导出 Excel 之后,在 B 、 D 、 H 、 J 列都出现了合并列情况,如图 3 黄色区域,这显然是程序员和用户都不想看到的现象,影响用户后期的 excel 处理。2、 解决方案仔细. 阅读全文

posted @ 2012-04-17 10:59 NewProgramer

如何设置rdlc报表的行数 怎么控制rdlc报表显示多少行
摘要:方法如下:打开一个报表,按F4,弹出下边的这个属性栏。修改 interactivesize 属性,把它调小。。。它的高度值除以你的数据行设置的高度 得到的结果就是 行数。。。如果不行,把pagesize也调小。。。 阅读全文

posted @ 2012-04-17 10:42 NewProgramer

RDLC报表:每页显示N条记录
摘要:摘要: 提供一种方案,使分页浏览的报表每页显示固定条数记录,最后一页记录条数不足的,用空行补齐。示例: 记录共7条,每页显示5条记录: 下载代码(vs2008,需要安装AdventureWorks数据库) 下载代码(vs2008,不需要数据库支持) 下载代码(仅rdlc报表定义文件)原理: 由于表的分组包含“在起始处分页”和”在结束处分页”的功能,所以我们考虑先将数据分成若干个记录条数为N的组,再启用“在结束处分页”的功能。 那么,如何分组呢?考虑记录的下标为 0,1,2,3... 的自然数序列,用下标除以N(设为3),得到以下数列: 0 /3 取整:0 1 /3 取... 阅读全文

posted @ 2012-04-17 10:41 NewProgramer

C# 导出Excel
摘要:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using Microsoft.Office.Interop.Excel;namespace test2{ public partial class Form2 : Form { public Form2() ... 阅读全文

posted @ 2012-04-12 15:55 NewProgramer

设置rdlc导出Excel的A4格式
摘要:如果你的数据比A4纸略大,如图:点“文件”——“页面设置”——“调整为”,如图:如果你的数据在A4纸上显得太小,则可将“缩放比例”调大,如图:——“确定”即可。 阅读全文

posted @ 2012-04-09 10:27 NewProgramer

Compiler Error Message: CS0433
摘要:Server Error in '/' Application.Compilation ErrorDescription: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0433: The type 'H 阅读全文

posted @ 2012-03-26 09:50 NewProgramer

GridView 编辑,更新,删除 等操作(转)
摘要:protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e){GridView1.EditIndex = -1;Bindgrid();}//编辑按键下的取消代码。将EditIndex=-1,然后在绑定数据库。protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e){string id = GridView1.DataKeys[e.RowIndex][0].ToString();Del 阅读全文

posted @ 2012-03-22 11:47 NewProgramer

设置导出报表时的文件名
摘要:private void reportViewer1_Load(object sender, EventArgs e) { this.reportViewer1.LocalReport.DisplayName = ALLMYCLASS.export_name; } 阅读全文

posted @ 2012-03-21 15:09 NewProgramer

ASP.NET2.0中ClientScriptManager的用法(转)
摘要:摘自:《道不远人:深入解析ASP.NET 2.0控件开发》 在ASP.NET中管理脚本,正是System.Web.UI.ClientScriptManager类的特长。ClientScriptManager类通过Page.ClientScript暴露。在控件内部,可以通过this.Page.ClientScript得到ClientScriptManager实例。ClientScriptManager类提供了大量生成客户端代码的方法:— RegisterArrayDeclaration——添加一个JavaScript数组到页面中。— RegisterClientScriptBlock——在页面的 阅读全文

posted @ 2012-03-13 12:03 NewProgramer

DataTable的使用
摘要:DBClass db = new DBClass(); string sql = "select * from Tfunction"; DataSet ds = db.GetDS(sql, "Tfunction"); int length = roleValue.Length; int i = 0; DataSet cds = ds.Copy(); foreach (DataRow dr in ds.Tables["Tfunction"].Rows) { if (i < le... 阅读全文

posted @ 2012-03-13 11:23 NewProgramer

转:Implementing Model-View-Controller in ASP.NET
摘要:原文链接:http://msdn.microsoft.com/en-us/library/ms998540.aspxNote:This content was developed in June 2003. It pre-dates ASP.NET MVC, and describes how to implement the Model-View-Controller pattern on top of ASP.NET Web Forms. For more information about ASP.NET MVC, see:ASP.NET MVC: The Official Micros 阅读全文

posted @ 2012-03-12 11:06 NewProgramer

ASP.NET页面生命周期
摘要:转自:http://www.cnblogs.com/vento/articles/1073822.html摘自:《Professional ASP.NET 2.0 Server Control and Component Development》p126The page goes through the following phases (notice some phases are marked as postback only becausethese are the phases that the page goes through only when it is posted back 阅读全文

posted @ 2012-03-09 11:33 NewProgramer

导航