日期:2014-05-18  浏览次数:20449 次

晕的 帮忙看下面的自定义控件的代码!谢谢拉
一直不能用中文用户名登录
但是没任何提示
是在看不出问题在哪里   谁帮我看一下啊
谢谢拉   马上结帐的

---------------------------
using   System;
using   System.Web.UI;
using   System.Web.UI.Design;
using   System.Web.UI.WebControls;
using   System.ComponentModel;
using   System.Web.Security;

namespace   book09
{
[
ParseChildren(true),
Description( "Login   Control "),
Designer(typeof(LoginControlDesigner)),
ToolboxData( " <{0}:LoginCustomControl   runat=server> </{0}:LoginCustomControl> ")
]
///   <summary>
///   LoginControl   的摘要说明。
///   </summary>
public   class   LoginCustomControl   :   System.Web.UI.WebControls.WebControl,   INamingContainer
{
public   static   string   USERNAME_STRING   =   "用户名: ";
public   static   string   PASSWORD_STRING   =   "密&nbsp;&nbsp;码: ";//两个字中间留空格
public   static   string   LOGIN_STRING   =   "登录 ";
public   static   string   RESET_STRING   =   "重置 ";
public   static   string   CAPTION_STRING   =   "用户登录 ";
public   static   string   REGISTER_STRING   =   "注册新用户 ";

private   TextBox   tbUserName;
private   TextBox   tbPassword;
private   Button   btnLogin;
private   Button   btnReset;
private   LiteralControl   vUserName;
private   LiteralControl   vPassword;
private   LinkButton   lbRegister;
private   bool   _show_register;

public   event   EventHandler   Login;
public   event   EventHandler   Reset;
public   event   EventHandler   Register;

protected   void   OnLogin(EventArgs   e)
{
if   (Login   !=   null)
{
Login(this,   e);
}
}

protected   void   OnReset(EventArgs   e)
{
if   (Reset   !=   null)
{
Reset(this,   e);
}
}

protected   void   OnRegister(EventArgs   e)
{
if   (Register   !=   null)
{
Register(this,   e);
}
}

public   string   UserName  
{
get  
{
this.EnsureChildControls();
return   tbUserName.Text;
}
set  
{
this.EnsureChildControls();
tbUserName.Text   =   value;
}
}

public   string   Password  
{
get  
{
this.EnsureChildControls();
return   tbPassword.Text;
}
set  
{
this.EnsureChildControls();
tbPassword.Text   =   value.ToString();
}
}

[
Browsable(true),
Category( "Behaviour "),
Description( "是否显示注册新用户链接 ")
]
public   bool   ShowRegister
{
get
{
return   _show_register;
}
set
{
_show_register   =   value;
}
}

protected   override