www.webdeveloper.com
Results 1 to 2 of 2

Thread: How to auto populate the textboxes based on value entered in one textbox in .net(c#)

  1. #1
    Join Date
    Feb 2014
    Posts
    1

    How to auto populate the textboxes based on value entered in one textbox in .net(c#)

    Hi,
    I am beginner in .net, please someone tell me how to auto populate other textboxes based on value entered in one textbox, please tell in detail..
    Any help will highly appreciated..

  2. #2
    Join Date
    Sep 2010
    Posts
    65
    In ASP.net you can change the text in Textbox1 and with the OnTextChange function be redirected to that subroutine.

    I believe aspx
    <asp:TextBox ID="TextBox1" runat="server" OnTextChanged="Textbox1_TextChanged"></asp:TextBox>

    aspx.cs
    public void Textbox1_TextChanged(object sender, EventArgs e)
    {
    Textbox2.text=Textbox1.text;
    Textbox3.text=Textbox1.text;
    ...
    }

    aspx.vb
    Protected Sub Textbox1_TextChanged(Byval sender as Object, Byval e as EventArgs) Handles Textbox1.TextChanged
    Textbox2.text=Textbox1.text
    Textbox3.text=Textbox1.text
    End Sub

    In Visual Basic.net You insert the textboxes and in Form1.vb type:
    Public Class Form1

    Sub Textbox1_TextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles TextBox1.TextChanged
    TextBox2.Text = TextBox1.Text
    TextBox3.Text = TextBox1.Text

    End Sub
    End Class
    Last edited by Philosophaie; 02-14-2014 at 01:29 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles