摘要:
Excel 可以保存成xml 格式,并且支持Sheet功能,因此,我们就可以利用这个功能将 Gridview 导出到多个 Sheet 中去。而且可以很好地控制导出的格式。下面就是完整的代码(注意:本站的代码都是可以直接复制、保存成aspx文件运行的。):ASPX 代码1<%@PageLanguage="C#"EnableViewState="true"%>23<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/ 阅读全文
摘要:
1///<summary>2///限制产品名称个数3///</summary>4protectedboolLimitProductName()5{6char[]textstr=(txtProductName.Text).ToString().ToCharArray();7inttemp=0;8boolresult=true;9for(intj=0;j<textstr.Length;j++)10{11if(textstr[j]=='')12{13temp++;14}1516}17string[]name=txtProductName.Text.Spl 阅读全文
摘要:
1for(inti=0;i<chlproductstander.Items.Count;i++)2{3if(chlproductstander.Items[i].Selected)4{5if(chlproductstander.Items[i].Text.IndexOf("其它")!=-1)6{7txtproductstander.Visible=true;8lbproductstander.Visible=true;9}10}11else12{13txtproductstander.Visible=false;14lbproductstander.Visible=f 阅读全文
摘要:
1///<summary>2///初始化CheckBoxList中哪些是选中了的</summary>3///<paramname="checkList">CheckBoxList</param>4///<paramname="selval"></param>5///<paramname="separator"></param>6publicstaticstringSetCheckBoxList(CheckBoxListcheckList,s 阅读全文
摘要:
1///<summary>2///得到CheckBoxList中选中了的值3///</summary>4///<paramname="checkList">CheckBoxList</param>5///<paramname="separator">分割符号</param>6///<returns></returns>7publicstaticstringGetCheckListText(CheckBoxListcheckList)8{9stringselva 阅读全文
摘要:
并实现添加下拉选择项1///<summary>2///绑定产品子类别3///</summary>4privatevoidBindType(stringtype)5{6DAL.Comm_SysDataDicSysDic=newDAL.Comm_SysDataDic();7DataSetds=SysDic.GetList("DicType='"+type+"'");8ddltype.DataSource=ds.Tables[0].DefaultView;;9ddltype.DataTextField="Dic 阅读全文
摘要:
1例如:1.ToString("000")数字格式化后为00123///<summary>4///生成备案号5///</summary>6///<returns></returns>7protectedstringTMaterialNo()8{9stringstrNo="";10boolflag=false;11List<Model.T_MaterialBackUp>mlist=newBLL.T_MaterialBackUp().GetModelList("CompanyUserID= 阅读全文
摘要:
获得当前文件夹下的文件名:stringpath="/MaterialBackUp"+Request.Path.Substring(Request.Path.LastIndexOf('/')例如:返回/MaterialBackUp/login.aspx 阅读全文
摘要:
1实现弹出对话框,选择“确定”与“取消”的对应操作!2this.ClientScript.RegisterStartupScript(typeof(string),"alert","if(confirm('您第一登录系统,请修改密码?')==true){location.href='index.aspx?updatepwd=yes';}else{location.href='index.aspx?updatepwd=no';}",true); 阅读全文
摘要:
实现DIV的水平居中1<divstyle="width:90%;text-align:left; margin:0auto;"> 阅读全文