Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

C# Visual Studio 2012: Updating Form on TextChanged Event

$
0
0

I am designing a User Control on my web form.

When a user inputs information into a TextBox, and clicks outside of the TextBox, I want a label to be set visible on the form.

Unfortunately, when I type in the TextBox and hit tab, nothing changes on the screen. BUT, if I click a button, then my label becomes visible. Here is my textchanged method:

protected void employee_TextChanged(object sender, EventArgs e)
{
            //  Checks that employee is valid
            if (employeeValid())
            {
                //  Set employeeLabel to display success
                label_EmployeeDetails.ForeColor = pallete[COLOR_GREEN];
                label_EmployeeDetails.Text = "Employee Valid!");

                //Ensure focus on next line
                textBox_Project.Focus();
            
                //  Allow visibility to employee detail label.
                label_EmployeeDetails.Visible = true;
            }

}

Please let me know how I can update my form after calling this method, without reloading the entire page!

Thanks, Ryan



Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>