All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
SQL,Server,2005数据库开发概述(2)_[SQL,Server教程]
FC,5,php,不可以连接远程mysql数据库_php资料_编程技术
如何制作圆角表格_[Html教程]
整站如何防止SQL注入攻击_[Asp.Net教程]
系统安全之Apache服务器实现用户验证_php资料_编程技术
将改变我们生活的这些XML应用_[XML教程]
PHP实例:PHP安全编程之加密功能_[PHP教程]
ASP.NET Remoting体系结构(一)
ADO.NET链接数据库DataAdapter对象应用实例
PHP开发技巧:PHP关于图像颜色的操作_php资料_编程技术
Reading number is top 10 pictures
More attractive than sora aoi2
Street street fighting
战场废物2
美女
做运动的校花2
The money of more than 100 countries and regions1
China's zhejiang university to create the world's most light material
可爱的小动物
Earthquake hedge common sense
Exquisite decoration is not paying too much3
Download software ranking
Twenty piece of palm leaf
The cock of the Grosvenor LTD handsome
C#COM编程指南
VC++6.0培训教程
matrix3
ASP.NET.2.0.XML.高级编程(第3版)
Boxer vs Yellow4
少妇苏霞全本
apache-tomcat-6.0.33
Tram sex maniac 2 (H) rar bag17
delv published in(发表于) 2014/1/24 9:03:32 Edit(编辑)
ASP.NET2.0,保存密码框的小技巧_[Asp.Net教程]

ASP.NET2.0,保存密码框的小技巧_[Asp.Net教程]

ASP.NET2.0 保存密码框的小技巧_[Asp.Net教程]

作者:清清月儿
主页:http://blog.csdn.net/21aspnet/


1.我们经常有这样的情形:

就是用户注册时由于某个信息填写错误要重新填写。但是这个过程经过了服务器PostBack。所以密码框就清空了。因为PostBack的时候,如果TextBox的TextMode为Password的话,是没有value属性传递的,所以密码框是空的。其实这个问题是可以解决的。


2.效果图:

普通情况下不能保存密码:

经过处理后可以保存密码



3.解决源代码


using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Lifetime;
using System.IO;


public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
this.Password.Attributes.Add("value", Request["Password"]);
}


protected void Button1_Click(object sender, EventArgs e)
{
}
}


前台代码
复制ASPX代码保存代码<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>





保存密码框的小技巧 http://blog.csdn.net/21aspnet/ 清清月儿







onClick="Button1_Click" />










添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.