Im getting a compilation error when running this code:
namespace WebApplication1
{
public partial class WebForm1 : System.Web.UI.Page
{
private Dictionary<string, string> _dictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); // let's ignore case when comparing.
protected void Page_Load(object sender, EventArgs e)
{
using (var reader = new StreamReader(File.OpenRead(@"C:/dictionary.csv")))
{
while (!reader.EndOfStream)
{
string[] tokens = reader.ReadLine().Split(';');
_dictionary[tokens[0]] = tokens[1];
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string output;
if (_dictionary.TryGetValue(TextBox1.Text, out output))
{
TextBox2.Text = output;
}
else
{
TextBox2.Text = "Input not recognised";
}
}
}
}
Here is the Compiler Error Message: CS1061: 'ASP.webform1_aspx' does not contain a definition for 'TextBox1_TextChanged' and no extension method 'TextBox1_TextChanged' accepting a first argument of type 'ASP.webform1_aspx' could be found (are you missing a using directive or an assembly reference?)
What does this mean and how can I correct it? Thanks