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

创建ASP.NET WEB自定义控件

本文通过一段完整的代码向读者介绍复合自定义控件的制作,包括:自定义属性、事件处理、控件间数据传递等方面的技术。
以下是一个登陆框的代码,包括:用户名输入TextBox、密码输入TextBox、提交Button、重置Button以及承载以上四项的Panel。控件类名为LoginCtrl。
(例程使用C#)
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Drawing;
namespace TestLib
{
      [DefaultProperty("BackColor"),
          ToolboxData("<{0}:LoginCtrl runat=server></{0}:LoginCtrl>")]
      public class LoginCtrl : System.Web.UI.WebControls.WebControl
      {
          private Color _fontColor = Color.Black;//声明字体颜色变量
          private Color _backColor = Color.White;//声明控件背景变量
首先声明要在复合控件中使用的子控件。
          private Label lblUserName = new Label();//显示“用户名”的Label控件
          private Label lblPassWord = new Label();//显示“密码”的Label控件
          private TextBox txtUserName = new TextBox();//用户名输入的TextBox控件
          private TextBox txtPassWord = new TextBox();//密码输入的TextBox控件
          private Button submitButton = new Button();//提交Button控件
          private Button clearButton = new Button();//重置Button控件
          private System.Web.UI.WebControls.Panel pnlFrame = new System.Web.UI.WebControls.Panel();//承载其它控件的容器Panel控件
当然要在符合控件中使用的事件一定要声明的,它们会出现在属性框的事件栏里。
 &n


相关文档:

ASP.NET按时间查询

select  top 6 *  from ViewHouseSale  where  1=1 and  (EstateType='0' or EstateType='1')
and DateDiff(day,PubDate,getdate()) <=7 and IfBenefit='Y' and IfValid='Y'  order by PubDate DESC
select  top 6 *  from ViewHouseSale  where  1=1 and&nb ......

asp.net注册用户通过email邮箱验证的实现方式

 public void SendSMTPEMail(string strSmtpServer, string strfrom, string strfromPass, string strto, string strSubject, string strBody)
{
System.Net.Mail.SmtpClient client = new SmtpClient(strSmtpServer);
client.UseDefaultCredentials = false;
client.Credentials = new System.Net.NetworkCre ......

ASP.net的url重写

1.
有关于URL的重写,本文也只是拿来主意。相继有MS的组件“URLRewriter”和在Global.asax里的“Application_BeginRequest()”编码方式,以及IIS里的ISAPI设置。
娜列下来,实现方法也都很简单。
 
方法一:MS组件
这里也不用详解了,相关请看:
http://www.microsoft.com/china/msdn/libra ......

asp.net身份验证和授权

login.aspx HTML代码
 1<%@ Page language="c#" Codebehind="02Login.aspx.cs" AutoEventWireup="false" Inherits="身份验证._02Login" %>
 2<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 3<HTM ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号