如果密码文本模式为另一个页面,如何将值传输到该文本框中,如果文本框处于密码模式,则该值需要在文本框中分配。 [英] How do I transfer a value if it is password textmode to another page and that value needs to assign in textbox if the textbox is in password mode.
本文介绍了如果密码文本模式为另一个页面,如何将值传输到该文本框中,如果文本框处于密码模式,则该值需要在文本框中分配。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是我的代码...
default.aspx.cs
- ---------------------
public string EmailId
{
get {返回 txtSignUpEmailId.Text.Trim(); }
}
public string 密码
{
get { return txtSignUpPassword.Text.Trim(); }
}
受保护 void btnSignUp_Click(对象发件人,EventArgs e)
{
Server.Transfer(& quot;〜/ Registration.aspx& quot;, true < /跨度>);
}
Registration.aspx.cs
------------------------
_Default d;
d =(_默认)Context.Handler;
txtEmailId.Text = d.EmailId;
txtPassword.Text = d.Password;
// txtPassword.TextMode = TextBoxMode.Password;
如果我没有删除评论行,那么我得到了结果。但 不安全,因为密码应为 星号或点格式。 emailid 即将发布,但密码字段 空白 registration.aspx.cs。请执行帮助我 as ...
解决方案
C#代码:
txtPassword.PasswordChar = ' @';
txtPassword.Attributes [ value] = d.Password;
这里我使用PasswordChar作为@ - 你可以根据需要改变。
注意:确保你是在d.password中获取价值
Hi,
here is my code...
default.aspx.cs
----------------------
public string EmailId { get { return txtSignUpEmailId.Text.Trim(); } } public string Password { get { return txtSignUpPassword.Text.Trim(); } } protected void btnSignUp_Click(object sender, EventArgs e) { Server.Transfer("~/Registration.aspx",true); } Registration.aspx.cs ------------------------ _Default d; d = (_Default)Context.Handler; txtEmailId.Text = d.EmailId; txtPassword.Text = d.Password; //txtPassword.TextMode = TextBoxMode.Password; If I am not removing the comment line then I am getting the result. But it is insecure because password should be in asterisk or dot format. The emailid is coming but password field is blank in registration.aspx.cs . Please do help me as soon as possible...解决方案C# Code:
txtPassword.PasswordChar = '@'; txtPassword.Attributes["value"] = d.Password;
Here I used PasswordChar as "@" - you can change as per your need.
Note: Make sure that you are getting value in d.password
这篇关于如果密码文本模式为另一个页面,如何将值传输到该文本框中,如果文本框处于密码模式,则该值需要在文本框中分配。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文