c# - Password control updated in the background does not reflect in the UI in ASP.NET web application -
i have asp.net web application want customize createuser wizard. in user registration workflow, instead of asking users enter password, generating password programmatically , assign password control when being loaded. control disabled , sent notification user. following snippets .aspx , corresponding c# code.
<asp:textbox id="password" runat="server" cssclass="passwordentry" textmode="password" onload="generaterandompassword" /> protected void generaterandompassword(object sender, eventargs e) { textbox pwdtextbox = (textbox)registeruserwizardstep.contenttemplatecontainer.findcontrol("password"); if (pwdtextbox != null) { pwdtextbox.text = membership.generatepassword(8, 2); } }
i have debugged code, can see text property of password text box set properly, not updated in ui. there else need do? can 1 tell me issue?
try set value password inputs:
pwdtextbox.attributes.add("value", membership.generatepassword(8, 2));
Comments
Post a Comment