Question about textbox. attributes ["value "]

Source: Internet
Author: User

This problem occurs during "modification". When you click "modify" in the background, some initial values appear in the text box.

Bll. Manager BLL = new BLL. Manager ();
Model. Manager model = BLL. GetModel (_ id );
Ddlroleid. selectedvalue = model. role_id.tostring ();
Rblislock. selectedvalue = model. is_lock.tostring ();
Txtusername. Text = model. user_name;
Txtusername. readonly = true;
If (! String. isnullorempty (model. user_pwd ))
{
Txtuserpwd. attributes ["value"] = txtuserpwd1.attributes ["value"] = defaultpassword;
// Txtuserpwd. attributes ["text"] = txtuserpwd1.attributes ["text"] = defaultpassword;
}

Txtuserpwd. attributes ["text"] cannot obtain the password in the text box, that is, the text box is empty, and txtuserpwd. attributes ["value"] is acceptable, but does textbox contain the attribute "value ??, I don't know much about it here. It turns into a human problem.

 

Textbox Control textm When ode = "password", after a server event is triggered, the display value of textbox is cleared.

 

This day I encountered a problem:

When the Textbox Control textmode = "password", after a server event is triggered, the display value of textbox is cleared.

I have been searching for a long time on the Internet and have not found any solution.

Therefore, I had to find a method to solve the problem. After a server event is triggered, the attacker found that the text value of textbox is not empty, at the same time, textbox1.attributes ["value"] = "123456789" is displayed on the Internet. It can be a textbox variable value.

So I will make it writable In the textbox ontextchanged event:

This. textbox1.attributes ["value"] = This. textbox1.text;

Or

This. textbox1.attributes ["value"] = request. Form [textbox1.clientid];

The result is OK.

However, if you want to release the value of textbox1 in the response, it will be cleared after a server event is triggered. In fact, there is no way to handle this problem during the hour.

If a friend has a better solution, please let me know. I have tried it here!

To ensure the consistency, onpaste = "Return false" oncut = "Return false" prevents the textbox from being glued to the lag or optimize mode.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.