I have this code (the problem lines have comments above them):
private async void btn_loginAdmin_Click(object sender, RoutedEventArgs e)
{
// 'txt_adminId' does not exist in the current context.
if (txt_adminId.Text = "root")
{
// 'txt_adminPw' does not exist in the current context.
if (txt_adminPw.Password = "password")
{
var msg_login = new MessageDialog("Logged in!");
await msg_login.ShowAsync();
}
else
{
var msg_login = new MessageDialog("Wrong password!");
await msg_login.ShowAsync();
}
}
else
{
var msg_login = new MessageDialog("Wrong combo!");
await msg_login.ShowAsync();
}
}
I have always had that problem with C#. I don't know what it means. But I'm sure that in this file's .xaml, those 2 text boxes exist.
- This is a Windows Store C# program.
EDIT:
Here's the output:
1>C:\Database\GH3_WSE\GH3_WSE\login_admin.xaml.cs(119,17,119,42): error CS0029: Cannot implicitly convert type 'string' to 'bool'
1>C:\Database\GH3_WSE\GH3_WSE\login_admin.xaml.cs(121,21,121,54): error CS0029: Cannot implicitly convert type 'string' to 'bool'