Click here to Skip to main content
15,911,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have customized createuserwizard control. I have taken two textboxes and a checkbox in a createuserwizard. what i want is when user checked the checkbox then TextBox1 value should go in TextBox2.

I am writing code on cheked_changed event of checkbox like below.. but event is not raised.. i think that is because checkbox is inside the createuserwizard.

C#
protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
   {
       if (((CheckBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("CheckBox1")).Checked == true)
       {
           ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("TextBox1")).Text = ((TextBox)CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("TextBox2")).Text;
           
       }
      
   }

Please suggest me can i resolve this problem??
Posted
Comments
DamithSL 31-May-14 1:36am    
can you update the question with createuserwizard aspx page markup?
Harpreet_125 31-May-14 1:51am    
below is my markup..

1 solution

Add below properties to your checkbox
ASP.NET
<asp:CheckBox ID="CheckBox2" runat="server" Text="Click here to send textbox1 value to textbox2" OnCheckedChanged="CheckBox1_CheckedChanged" AutoPostBack="True" />
 
Share this answer
 
v2
Comments
Harpreet_125 31-May-14 2:06am    
Thank you so much Damith SL.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900