首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

|M| 怎么对Passwod模式的TextBox进行赋值

2012-01-08 
|M| 如何对Passwod模式的TextBox进行赋值我在程序中写txtPass 123456 但在页面中却是为空的怎么办[解决

|M| 如何对Passwod模式的TextBox进行赋值
我在程序中写txtPass= "123456 "
但在页面中却是为空的
怎么办

[解决办法]
try:
txtPass.Attributes.Add( "value ", "123456 ");
[解决办法]
是啊,很简单的,100分就这么没了
[解决办法]
楼上正解
[解决办法]
最好是这样 if (this.IsPostBack {if( this.txtPass.Text.Trim()!= "****** "){ this.Password = this.txtPass.Text.Trim(); } txtPass.Attributes.Add( "value ", "******* "); } protected string Password { get { return ViewState[ "Password "] != null ? (string)ViewState[ "Password "] : " "; } set { ViewState[ "Password "] = value; } }使用的时候用this.Password
[解决办法]
灌水.

热点排行