自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Allen_白的专栏

.NET,ASP.NET,BI个人经验和总结

  • 博客(38)
  • 资源 (4)
  • 收藏
  • 关注

原创 .net后台使用javascript

string alertString = "alert('123'); ";Page.ClientScript.RegisterStartupScript(this.GetType(), "radalert", alertString);return; popup an alert.

2012-06-27 17:25:20 470

原创 .Net Using的用法

1.引用命名空间,减少冗余代码。Using System.Web.UI.WebControls; 2.即时释放资源。Using (TestObject a = new TestObject())  {// 使用对象}//对象资源被释放

2012-06-06 17:39:41 561

原创 WCF中的ABC

我们知道WCF中,Client端和Service端是通过Endpoint来通信的,Endpoint有包含3个部分,经典地称为ABC。A代表Address,它包含一个URI,它指明Service存在于网络的某个地方,也就是说它为Client断指明在什么地方去找到这个Service。很多人认识Address仅仅只是一个具有Identity的URI,实际上不然, Address不止于此,它还包含一些

2012-06-06 11:05:58 3485 1

转载 async and await 简单的入门

async and await简单的入门如果有几个Uri,需要获取这些Uri的所有内容的长度之和,你会如何做? 很简单,使用WebClient一个一个的获取uri的内容长度,进行累加。也就是说如果有5个Uri,请求的时间分别是:1s 2s 3s 4s 5s. 那么需要的时间是:1+2+3+4+5=(6*5)/2=15.如果采用并行计算的话,结果可能是这样

2012-06-05 16:00:46 686

原创 MDX查询个人小节

STEP 1.===============================================================================WITH MEMBER [Team].[teamName].TotalAS Aggregate ( { [Team].[teamName].&[AP Doc_Capture],[Team].[teamName].

2012-06-05 10:30:32 752

转载 15个很具代表性的MDX查询语句

15个很具代表性的MDX查询语句     读者请求最多的是更多的MDX信息。他们通常要求更多的MDX例子,在这里,我提供15个典型的MDX语句,用的是SQL Server 2000 Analysis Services' FoodMart 2000 sample cubes,以下例子都以Sales多维数据集为例。1. 在美国所有州都销售的有那些产品品牌?Listing 1 创建了

2012-06-05 00:43:45 3896

原创 自定义list排序

/// 比较两个FileMeta(model)的部门名称,按部门名称排序  public class Icp_depID : IComparer           {            public int Compare(FileMeta x, FileMeta y)            {                return (x.DepartmentID)

2012-06-05 00:41:06 531

原创 先弹出对话框,然后跳转页面

string userID = this.USER_ID.Text; Page.RegisterStartupScript("a", "alert('员工:" + userID + "恢复成功');"); Page.ClientScript.RegisterStartupScript(this.GetType(), "key", @"window.location.href ='./A

2012-06-05 00:40:04 3045

原创 委托

public class SmtpMailSender    {  public delegate string Get_Mail_Body();      public Get_Mail_Body func1 = null;        public SmtpMailSender(ReportExc repe, string leader) //构造函数

2012-06-05 00:39:02 435

原创 事务处理(例子)

首先添加引用System.Transaction  ///         /// 删除后必定插入数据,否则不删除(事务处理)        ///         ///         ///         public void AddIfDeletSucc(List list_wrc, int repId)        {  !!!           us

2012-06-05 00:38:40 723

原创 实现GridView里的checkbox 全选功能:(后台实现)

如何获取GridView中HeaderTemplate里面控件的值(附加checkbox全选功能)在头模版里有个CheckBox1,如何得到这个控件的值,事件由控件CheckBox1来AutoPostBack(!!!!!!!!!)CheckBox cbAll = (CheckBox) GridView1.HeaderRow.FindControl("CheckBox1");实现Grid

2012-06-05 00:37:27 3327

原创 上传文件太大(处理)

首先,在Global.asax.cs中实现Application_BeginRequest方法,实例HttpWorkerRequest wr = (HttpWorkerRequest)provider.GetService(typeof(HttpWorkerRequest))来获取web.config中的maxLength长度,同时开辟一个内存wr(大小为maxLength);然后用GetPrel

2012-06-05 00:36:48 2236

原创 上传附件(满1000个文件则自建新文件夹)

///         /// 上传附件按钮        ///         ///         ///         protected void send_btn_Click(object sender, EventArgs e)        {            this.report_submit_state.Text = "";

2012-06-05 00:35:51 2072

原创 缓存技术

在page指令下面加入 缓存20秒

2012-06-05 00:35:19 465

原创 后台改textBox颜色

this.USER_ID.BackColor = System.Drawing.ColorTranslator.FromHtml("#CCCCCC")

2012-06-05 00:34:14 1313

原创 split分割字符串

string[] tmp = weekcode.Split(new char[] { '_' });            string yr = tmp[0];            string wk = tmp[1];string[] tmp = Regex.Split(eachL, "error", RegexOptions.IgnoreCase);       //用字符

2012-06-05 00:33:52 376

原创 定义非零的时候格式成保留一位小数

定义非零的时候格式成保留一位小数:String.Format("{0:##0.0}", MonValue * 100)

2012-06-05 00:32:19 633

原创 调用dbml数据连接

connectionString="data source=10.100.68.209;Initial Catalog=SSBU_EPlat_db;User ID=sa;Password=admin-123"       providerName="System.Data.SqlClient" />  .....      (DBML Name is S

2012-06-05 00:31:47 904

原创 实现从服务器下载文件代码

#region 下载服务器上的文件    ///     /// 下载服务器上的文件    ///     /// 程序中可以设置参数:HttpResponse ht=Page.Response;    /// 服务器上的文件路径    public void DownloadFile(string serverPath)    {        FileStrea

2012-06-05 00:30:26 1260

原创 web.config数据库联接字符串的设置与读取

web.config                      connectionString="data source=.;Initial Catalog=DBName;User       ID=sa;Password=sa"          providerName="System.Data.SqlClient" />   读取string c

2012-06-05 00:28:07 370

原创 StringFormat

// just two decimal placesString.Format("{0:0.00}", 123.4567);      // "123.46"String.Format("{0:0.00}", 123.4);         // "123.40"String.Format("{0:0.00}", 123.0);         // "123.00"Next ex

2012-06-05 00:27:18 602

原创 Repeter控件+带参数linkbutton下载

文件名称:                                类型:                                版本:                                语言:                                文件大小:

2012-06-05 00:26:15 925

原创 Ref和Out的区别

ref是传递参数的地址,out是返回值,两者有一定的相同之处,不过也有不同点。使用ref前必须对变量赋值,out不用     //这是主要区别out的函数会清空变量,即使变量已经赋值也不行,退出函数时所有out引用的变量都要赋值,ref引用的可以修改,也可以不修改。 区别可以参看下面的代码:using System;class TestApp{ static v

2012-06-05 00:25:19 443

原创 Partial Class 把一个巨大的类文件可以拆成好几个类由不同的程序员来开发

Partial Class 把一个巨大的类文件可以拆成好几个类由不同的程序员来开发(ExampleClassFile1.cs文件)public partial class ExampleClass{ public string method1() {  return "partial class 方法1"; }}(ExampleClassFile2.cs文件)

2012-06-05 00:24:08 1572

原创 metaresourcekey实现多国语

实现多国语言用cookie存储 EN,CN等等关键字打开页面的design,然后tools-->Generate Local Resource生成App_LocalResources文件夹及.resx文件配置空间的.Text ,Title,ToolTip  然后在页面中使用meta:resourcekey="关键字"掉用 如在.resx中   RadDockZone1Res

2012-06-05 00:23:17 1514

原创 使用master母板页FindControl问题

((Label)this.Master.FindControl("MainContent").FindControl("current_item_gruop_pro_" + index_curr)).Text = wrcc.ProductName;在带有master的内容页中,要findcontrol 需要先this.Master.FindControl("MainContent")  //M

2012-06-05 00:22:00 625

原创 GridView某一列宽度(相对于gridview外层控件)

非常简单  this.GridView1.Columns[1].ItemStyle.Width=Unit.Percentage(50);

2012-06-05 00:20:14 546

原创 gridview中radiobutton实现单选

protected void RadioButton1_CheckedChanged(object sender, EventArgs e)        {                        int row = ((GridViewRow)((RadioButton)sender).NamingContainer).RowIndex;  //获得选中行

2012-06-05 00:19:25 531

原创 gridview数据绑定

Gridview的绑定方式之一: DataView dt = new DataView();   //新建一个DataView对象,可作为DataSource            DataTable dtt = new DataTable("haha");            {                dtt.Columns.Add("a");

2012-06-05 00:17:33 473

原创 GrideView上的_RowCommand事件传值

function 1:  protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)        {  !!!!!          int index = Convert.ToInt32(e.CommandArgument);   //获得选中的行  !!!!!

2012-06-05 00:15:44 769

原创 DropdownList初始选中

this.ID_DEPARTMENT.ClearSelection(); //清除已选项 ListItem item = ID_DEPARTMENT.Items.FindByText(department.Trim()); //根据一个值"department.Trim()"查找是否droplist里有 if   (item   !=   null)   item.Selected

2012-06-05 00:14:07 394

原创 DBNull的应用

DBNull表示为空数据,注意不是Null不是“”,是数据不存在 double units = dataTable.Rows[i][1] == DBNull.Value ? 0 : Convert.ToDouble(dataTable.Rows[i][1]);

2012-06-05 00:12:27 337

原创 DateTime转为yyyyMMdd

Fun1: string stateDate = mem_info.SingingTime.ToString();     //mem_info.SingingTime为dateTime型DateTime state = Convert.ToDateTime(stateDate);string stateDateFormat = state.ToString("yyyy/MM/dd

2012-06-05 00:10:48 3961

原创 dateTime应用

1.给一个datetime加12个小时: public DateTime timeFormat (DateTime datePM)        {            TimeSpan toformat = new TimeSpan(0,12,0,0);   //(天,时,分,秒)            DateTime trueDate = datePM.Add(toform

2012-06-05 00:09:55 320

原创 DataBinder.Eval

DataBinder.Eval的基本格式在绑定数据时经常会用到这个句程序:或者今天又学到一种,而且微软也说这种方法的效率要比以上两种高。很有用的,这样可以在前台页面做好多事情了。还要记住要这样用必须要在前台页面导入名称空间System.Data,否则会生成错误信息。这种用法其实和是一个道理。Text=''这样的方法是最快的Text=''也可以绑定方法,但

2012-06-05 00:08:43 323

原创 appSetting调用

app.Config文件中添加           后台调用using System.Configuration;ConfigurationManager.AppSettings["debug"]

2012-06-05 00:07:17 823

原创 AJAX控件学习-简单例子

用ASP.NET自带AJAX控件实现页面无刷新变色前台代码                                                                               后台代码using System;using System.Collections.Generi

2012-06-05 00:06:05 431

原创 二进制判断权限

int role = masHandle.GetRoleByMemberID(str_member_badge);            if ((role & 2) != 2)//没有主管权限            {                for (int i = 1; i                 {                    ((Panel)t

2012-06-05 00:02:58 1272

Screwturn wiki sqlserver

release 的screwturn 直接部署就可使用

2014-09-17

Slider相册 带左右和1,2,3小图标

Slider相册 带左右和1,2,3小图标

2013-08-02

AngularJSDemos

AngularJSDemos

2013-08-02

Infragistics.Web.Mvc

Infragistics.Web.Mvc dll,css,js,samples

2013-06-19

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除