随笔分类 -  ASP.NET

这里是.net的技术资源,这里见证我要在微软这条路上走下去,由浅入深。
摘要://////绑定所有图片列表////////////protectedvoidBindListPicPager(Repeatera,AspNetPagerAspNetPager1,Expression>filter){using(varcontext=newJGDJEntities()){varne... 阅读全文
posted @ 2015-05-28 18:03 calochCN 阅读(115) 评论(0) 推荐(0)
摘要:对于webfom,一种写法,将所有业务单元封装在一个pagebase里面,所有的页面继承自pagebase这个service外观,这样的结果就是,所有的页面单元上代码量会非常少。最大程度减少耦合,而最终要的效果就是,这样的系统非常容易维护。在控件上用语义化和action来整理,封闭内部内容。只暴露配... 阅读全文
posted @ 2015-05-28 18:00 calochCN 阅读(146) 评论(0) 推荐(0)
摘要:usingJGDJWeb.Model;usingSystem;usingSystem.Collections.Generic;usingSystem.IO;usingSystem.Linq;usingSystem.Security.Cryptography;usingSystem.Text;usin... 阅读全文
posted @ 2015-05-28 14:25 calochCN 阅读(242) 评论(0) 推荐(0)
摘要://////根据请求分类判断当前活动列表项/////////publicStringGetCClass(intindex){varclassCName=Request["classCName"]??"文";varreturnValue=String.Empty;vararray=newString[... 阅读全文
posted @ 2015-05-27 14:38 calochCN 阅读(104) 评论(0) 推荐(0)
摘要:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web; usingSystem.Xml; namespaceSystem{ //////XMLHelperXML文档操作管理器///publiccl... 阅读全文
posted @ 2015-05-27 11:20 calochCN 阅读(183) 评论(0) 推荐(0)
摘要://////绑定新闻列表,带分页与查询////////////protectedvoidBindList(Repeatera,AspNetPagerAspNetPager1,Expression>filter){ClassNo=Request["ClassNo"];varnew_list=newLi... 阅读全文
posted @ 2015-05-27 10:53 calochCN 阅读(246) 评论(0) 推荐(0)
摘要:/// /// 过滤不安全的字符串 /// /// /// public static string FilteSQLStr(string Str) { Str = Str.Replace("'", ""); Str = Str.Replace("\"", ""); Str = Str.Re... 阅读全文
posted @ 2015-05-25 20:48 calochCN 阅读(738) 评论(0) 推荐(0)
摘要:usingSystem.Text.RegularExpressions;usingSystem.Web; internalclassHtmlHelper{/// ///去除HTML标记 /// ///包括HTML的源码 ///已经去除后的文字 publicstaticstringNoHTML(str... 阅读全文
posted @ 2015-05-25 19:55 calochCN 阅读(615) 评论(0) 推荐(0)
摘要:这是最近在干一个webform的cms的时候用起来的,原来虽然做过很多技术,什么remoting,wcf,webservice,可是弄来弄去,最后也没个收藏的地儿,全都放在笔记本儿上了,可是人又懒地可以,做来做去,最后它们还是扔在那里。说正题吧:最近用到的这套小型的cms,主就是用的链表了,大部分的... 阅读全文
posted @ 2015-05-25 19:54 calochCN 阅读(276) 评论(1) 推荐(0)
摘要:Ps:记一下用的时候,一不小心我手贱碰到的问题吧:我在页面里面加上了form runat=server,然后所有的html控件就再也找不着了。就是下面的control collection这里,如果加上form runat=server标签,页面里面所有的控件就会变为form控件的子集。这样产生了问... 阅读全文
posted @ 2015-05-22 16:35 calochCN 阅读(256) 评论(0) 推荐(0)
摘要:1.母版页在标签中可以设置,注意标签是runat="server"的。2.子页在有个Title属性,默认值是Untitled Page,如果想用母板页的Title,可以将此属性去掉或值改为空。3.母版页和子页在后台代码Page_Load中都可以加上Page.Title = "..." 来设置标题。优... 阅读全文
posted @ 2015-05-22 10:14 calochCN 阅读(176) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2015-05-22 09:34 calochCN 阅读(3) 评论(0) 推荐(0)
摘要:这个是页面里的代码需要在上面引入: 后台用法:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSystem.Web.UI;usingSystem.Web.UI.WebControls;... 阅读全文
posted @ 2015-05-22 09:29 calochCN 阅读(379) 评论(0) 推荐(0)
摘要:做了一个封装,使页面更容易维护一些。主要是两个方法,如下所示: privatevoidBindModule(ActionbindSingRpt){BindControls(this,"List_",bindSingRpt);}privatevoidBindControls(Pagepage... 阅读全文
posted @ 2015-05-21 16:39 calochCN 阅读(146) 评论(0) 推荐(0)
摘要:using System;using System.Collections.Generic;using System.Configuration;using System.Data;using System.Data.Common;using System.Reflection;using Syst... 阅读全文
posted @ 2015-05-20 21:38 calochCN 阅读(516) 评论(1) 推荐(2)
摘要:.net framework中使用扩展方法,由网摘上看到,是因为编译器将扩展方法带上了ExtensionAttribute特性要在.net framework 2.0中使用的话,可以自定义一个特性:namespaceSystem.Runtime.CompilerServices{publicclas... 阅读全文
posted @ 2015-05-20 17:51 calochCN 阅读(464) 评论(0) 推荐(0)
摘要:usingSystem;usingSystem.Collections.Concurrent;usingSystem.Collections.Generic;usingSystem.Data;usingSystem.Linq;usingSystem.Net.NetworkInformation;us... 阅读全文
posted @ 2015-05-20 16:04 calochCN 阅读(322) 评论(0) 推荐(0)
摘要:公司封装框架的人把eF封在了工作单元里面,使用了Unitofwork这样的形式,我用代码生成器生成了基础的单表操作的代码。这种方式对多表有问题。暂时只得,一张表一张表地操作,我采用先用List存所有id的方式。然后再对比,存储的更新,不存在的添加,最后删除掉原来有现在没有的Id的方式。前端开发,渐渐... 阅读全文
posted @ 2015-04-01 19:02 calochCN 阅读(288) 评论(0) 推荐(0)