I keep getting the error
The name '****' does not exist in the current context
when trying to start the application. No idea why. No spelling error, I've checked it over and over and I'm not sure if I've missed something out? The error occurs for TxtUsername, TxtPassword and LblMessage Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
namespace MusicShop.Admin
{
public partial class Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void BtnLogin_Click(object sender, EventArgs e)
{
string Username = WebConfigurationManager.AppSettings["AdminLoginID"];
string Password = WebConfigurationManager.AppSettings["AdminPassword"];
if (TxtUsername.Text == Username && TxtPassword.Text == Password)
{
Session["MusicShopAdmin"] = "MusicShopAdmin";
Response.Redirect("#/Admin/AddNewSong.aspx");
}
else
{
LblMessage.Text = "Wrong Username or Password";
}
}
}
}