易截截图软件、单文件、免安装、纯绿色、仅160KB

定义和使用ASP.NET Profile(附例)

1、双击一个数据源控件,将要存储profile的数据库作为数据源加入控件(这个步骤没什么用,只是为了方便大家用控件建立连接,这样不容易出错),建立好之后将design页面的数据源控件删除,你会发现在web.config里还是有一条连接语句,不要删除,我们下面将用到它,如: <connectionStrings>
  <add name="aspnetdbConnectionString" connectionString="Data Source=JAMESSHENG;Initial Catalog=aspnetdb;Integrated Security=True" providerName="System.Data.SqlClient"/>
 </connectionStrings>
2、定义Profile,在源码中加入
  <profile enabled="true" automaticSaveEnabled="true" defaultProvider="SqlProvider">
   <providers>
    <clear/>
    <add name="sqlProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="aspnetdbConnectionString" applicationName="ProfileSample" description="Sample for asp.net Profile and Profile Service"/>
   </providers>
   <properties>
    <add name="BackGroudColor" type="System.String" allowAnonymous="true"/>
   </properties>
  </profile>
  <anonymousIdentification enabled="true"/>
//defaultprovider指定默认配置文件提供程序的名称 
   automaticSaveEnabled指定用户配置文件是否在 ASP.NET 页执行结束时自动保存。如果为true,则用户配置文件在 ASP.NET 页执行结束时自动保存。
   providers(可选元素)定义配置文件提供程序的集合,它当中包含<add> :name = defaultProvider的值;type = System.Web.Profile.SqlProfileProvider是使用sql;connectionStringName = aspnetdbConnectionString使用上面连接中定义的连接字符串;
properties(必选的元素)定义用户配置文件属性和属性组的集合,它当中包含<add>:name=“BackGroudColor”定义Profile中的属性名称;type="System.String"字符串类型;allowAnonymous="true"定义是否保存匿名用户配置,如果在此处定义true,则在后面必须加入<anonymousIdentification>配置,设


相关文档:

ASP.NET创建缩略图

在学习过程中发现如果要上传的照片很大的话,速度会很慢,所以采用了在上传照片时同时上传缩略图的方式,这样就可以既不影响多个图片的浏览,又不影响查看具体的图片。
需要用到的命名空间:
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
#region 保存上传文件,方法名:UploadSave(string ......

在ASP.NET AJAX中防止用户多次提交页面

在Web开发程序中,往往由于种种原因,客户会多次操作页面导致数据冗余或不一致, 在ASP.NET AJAX出现之前可以通过对__dopostback()的调用等方法也可以防止页面多次提交。
在ASP.NET AJAX中的页面客户端中有一个叫onInitializeRequest的事件,它在页面初始化之前触发,可以对页面的提交事件进行控制,并且可以调用该事件参 ......

asp.net 设置出错页

    <system.web> 
      <!--********出错页的设定********-->
    <customErrors mode="On" defaultRedirect="~/Error.htm"> </customErrors> ......

ASP.NET MVC2 学习笔记之URL路由

    新建一个默认的ASP.NET MVC2应用程序,系统会默认的生成包含基本功能的应用程序,查看这些生成的代码,可帮助我们理解ASP.NET MVC2。下面是对URL路由的理解,以备忘。
一、Global.asax.cs中的代码:
public class MvcApplication : System.Web.HttpApplication
    {
  &n ......

ASP.NET GridView的使用详解


这是要实现的功能:
第一步:拖入GridView控件 并且完成查询所有数据的方法 通过this.GridView1.DataSource 获取集合数据   GridView1.DataBind() 绑定数据
第二步:实现全选功能
1. 页面代码:
代码
 <asp:TemplateField HeaderText="全选">
       &nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号