代码改变世界

随笔分类 -  ASP.NET

Changing Project Binding to Surround SCM Integration Provider with Visual Studio 2010

2013-12-11 13:51 by Tracy., 499 阅读, 收藏, 编辑
摘要: Changing Project Binding to Surround SCM Integration Provider with Visual Studio 2010Sarah Wigsertalks aboutSurround SCMon November 18, 2011Andrew Horner, one of our Sales Engineers, was recently on-site with a customer that purchased Surround SCM, and had a large amount of source code which they wa 阅读全文

转:数据格式化-Eval( " ")和DataBinder.Eval(Container.DataItem, " ")的区别及用法

2011-12-27 14:41 by Tracy., 496 阅读, 收藏, 编辑
摘要: 一些数据格式化-Eval( " ")和DataBinder.Eval(Container.DataItem, " ")的区别及用法 ASP.NET 2.0改善了模板中的数据绑定操作,把v1.x中的数据绑定语法DataBinder.Eval(Container.DataItem, fieldname)简化为Eval(fieldname)。Eval方法与DataBinder.Eval一样可以接受一个可选的格式化字符串参数。缩短的Eval语法与DataBinder.Eval的不同点在于,Eval会根据最近的容器对象(例如DataListItem)的DataIt 阅读全文

ASPNET:DateFormatString详解

2011-11-02 09:36 by Tracy., 1814 阅读, 收藏, 编辑
摘要: 1、 为什么设置了DataFormatString没有效果?不要忽略BoundField的两个重要属性HtmlEncode和ApplyFormatInEditMode。HtmlEncodeGridView 使用的 BoundField 与 DataGrid 使用 BoundColumn 不同,BounField 提供了一个 HtmlEncode 属性,提供是否对数据进行HTML编码,降低了 BoundColumn 潜在的Html &Script 嵌入攻击,默认该值是启用的。如果要使用格式化输出,应该关闭此属性。<asp:BoundField DataField="Hir 阅读全文

了解IHttpModule接口事件执行顺便 获取Session

2011-09-14 17:23 by Tracy., 213 阅读, 收藏, 编辑
摘要: 最近公司一个项目让人SQL注入了~为了临时先解决这个问题,使攻击者不再危害数据库。初步决定先采用IHttpModule过滤一道请求。public class HttpModule:IHttpModule{ public HttpModule() { // // TODO: 在此处添加构造函数逻辑 // } IHttpModule 成员#region IHttpModule 成员 public void Init(System.Web.HttpApplicati... 阅读全文

Ihttphandler,Ihttpmodule

2011-09-14 17:20 by Tracy., 371 阅读, 收藏, 编辑
摘要: 1.ihttpModule(粘合剂,侦听application事件或用户自定义事件。)2.ihttpHandler(可以自定义对特定资源进行处理)2.ihttpHandlerFactory(可以用来进行在自定义ihttpmodule或标准的ihttpModule之间进行选择)ihttpHandler拦截httpRequest.ihttpModule是事件侦听器(其作用跟glob.aspx有些相同)区别:ihttpHandler 完全负责页面的请求和响应ihttpModule 负责在其Init事件中申请的HttpApplication事件,执行完还要按HttpApplication其他事件执行应 阅读全文

Server.MapPath

2011-06-30 13:44 by Tracy., 262 阅读, 收藏, 编辑
摘要: Server.MapPath specifies the relative or virtual path to map to a physical directory. Server.MapPath(".") returns the current physical directory of the file (e.g. aspx) being executed Server.MapPath(... 阅读全文

Displaying Dynamic KML with ASP.NET

2010-11-24 17:09 by Tracy., 346 阅读, 收藏, 编辑
摘要: Backcountry Secrets wanted to display KML files for each of their points on their maps.  I didn't want to store all of the KML files on my server, but I wanted to store them in a MySQL database.&... 阅读全文

转:SqlCacheDependency 基于多表的缓存应用

2010-09-30 17:21 by Tracy., 286 阅读, 收藏, 编辑
摘要: SqlCacheDependency基于表的缓存应用在sql2000,以及slq20005中实现的原理多一样,多是在需要检测的表上建立触发器,并且Asp.net运行时通过轮询机制来检测表数据是否更改.   使用步骤   首先保证数据库里有相应的基础结构,可以通过aspnet_regsql来配置,   –S 服务器名称 –U 登陆ID –P 密码 –d 数据库名称 –t... 阅读全文

SQL Cache Dependency

2010-09-30 17:15 by Tracy., 547 阅读, 收藏, 编辑
摘要: Caching is a very useful way for you to retain pages or data across HTTP requests, so that you can reuse them without the recreating them. In ASP.net 2.0, it makes you easier to implement data cachin... 阅读全文

网上购物车数据库设计

2010-09-30 15:37 by Tracy., 828 阅读, 收藏, 编辑
摘要: 一、概述 网上购物店的数据模型,它主要模式有产品:product ,帐户:Account,定单:Order。和产品相关的表有category ,product,item, inventory, supplier;和用户相关表有的account ,signon ,profile;和定单相关的表有orders,orderstatus,lineitem FK:Foreign Key 二、帐户模型 ... 阅读全文

FindControl

2010-08-26 15:37 by Tracy., 358 阅读, 收藏, 编辑
摘要: Here is some C# code which should be easy to convert. Pass in the id "lblRecTonT" and the control collection Page.controls or GridView1.Controls. This is guaranteed to work if the ID exists.... 阅读全文

Storing Binary Files Directly in the Database Using ASP.NET 2.0

2010-07-22 14:46 by Tracy., 480 阅读, 收藏, 编辑
摘要: IntroductionIn building a data-driven application, oftentimes both text and binary data needs to be captured. Applications might need to store images, PDFs, Word documents, or other binary data. Such ... 阅读全文

Using ASP.NET 3.5's ListView and DataPager Controls: Displaying Data with the ListView

2010-07-22 14:17 by Tracy., 380 阅读, 收藏, 编辑
摘要: IntroductionIn November 2007 Microsoft released ASP.NET 3.5. As noted in An Overview of ASP.NET 3.5 and Visual Studio 2008, this released included two new ASP.NET data Web controls: the ListView and D... 阅读全文

Passing Information Between Content and Master Pages .

2010-07-22 14:04 by Tracy., 301 阅读, 收藏, 编辑
摘要: IntroductionWhen graphic designers create a layout for a Web site, they typically break down page layout into distinct regions, such as a common header that includes the logo and various navigation li... 阅读全文

Dynamically Setting the Page's Title in ASP.NET 2.0 or By SiteMap

2010-07-22 13:46 by Tracy., 325 阅读, 收藏, 编辑
摘要: Creating a Programmatically-Accessible <head> RegionOne of the many new features found in ASP.NET 2.0 is the programmatically-accessible <head> region, which can be added to an ASP.NET pag... 阅读全文

Fw:Managing View State in ASP.NET 4 Using the New ViewStateMode Property

2010-07-22 13:14 by Tracy., 283 阅读, 收藏, 编辑
摘要: IntroductionThe ASP.NET Web Forms model strives to encapsulate the lower level complexities involved in building a web application. Features like server-side event handlers, the page lifecycle, and vi... 阅读全文