|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
[解决办法]
灌水.