?
Solved

Update Other Text on Textbox TextChanged Event

Posted on 2010-09-21
4
Medium Priority
?
977 Views
Last Modified: 2012-05-10
Hi,
I have been trying to get the TextChanged Event to fire in the code behind, after someone has edited a textbox.
I have autopostback = true, and have tried creating another event and then assign it to the textbox control.
I can't get any event to fire.
I am using the wizard control and the code behind recognizes the textboxes.
What am I doing wrong????
Protected Sub txtFirstName_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtFirstName.TextChanged
          SetFullName()
     End Sub

     Public Sub SetFullName()
          Me.txtFullName.Text = Me.txtFirstName.Text & " " & Me.txtLastName.Text
          Me.txtDomain.Text = Me.txtFirstName.Text & Me.txtLastName.Text
          Me.lblDomain.Text = "www.sms.com/" & Me.txtDomain.Text
     End Sub

     Protected Sub txtLastName_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtLastName.TextChanged
          SetFullName()
     End Sub


<tr>
                              <td>
                                   First Name:</td>
                              <td>
                                
                                   <asp:TextBox ID="txtFirstName" runat="server" CssClass="wizardboxes"
                                        MaxLength="50" Width="70%" AutoPostBack="true" ></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                        ControlToValidate="txtFirstName" Display="Dynamic" 
                                        ErrorMessage="First name is required."></asp:RequiredFieldValidator></td>
                          </tr>
                          <tr>
                              <td>
                                   Last Name:</td><td>
                                   <asp:TextBox ID="txtLastName" runat="server" CssClass="wizardboxes" 
                                        MaxLength="50" Width="70%" AutoPostBack="true"  ></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                        ControlToValidate="txtLastName" Display="Dynamic" 
                                        ErrorMessage="Last name is required."></asp:RequiredFieldValidator></td>
                          </tr>

Open in new window

0
Comment
Question by:Sheritlw
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 65

Expert Comment

by:rockiroads
ID: 33731923
did u try placing a breakpoint and run it thru debugger?

0
 
LVL 65

Assisted Solution

by:rockiroads
rockiroads earned 1000 total points
ID: 33731929
I prefer my code to be behind the module.

how did u generate this code? did u go into design view then double click on the control? or something along those lines?

gotta go, be back in the a.m.
0
 
LVL 16

Assisted Solution

by:MikeMCSD
MikeMCSD earned 1000 total points
ID: 33731937
See if this works:

<asp:TextBox ID="Address1" runat ="server"></asp:TextBox>
<br />
<asp:TextBox ID="Address2" runat ="server"></asp:TextBox>


 protected void Page_Load(object sender, EventArgs e)
  {
    Address1.Attributes.Add("onkeyup", "document.getElementById('Address2').value= document.getElementById(this.id).value;");
.......
0
 

Accepted Solution

by:
Sheritlw earned 0 total points
ID: 33731992
Hi, everyone

I appreciate all your answers and will split the points between you, but I found out what I didn't do.
Something simple
EnableViewState="true"

Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question