Can anyone please explain why I cannot declare the two variable hardwareID and docPath in the code below? I'm still learning .
public partial class Controls_WebUserControl : System.Web.UI.UserControl { string hardwareID = Request.QueryString["HardwareID"]; string docPath = "~/Documents/Hardware/" + hardwareID + "/"; protected void Page_Load(object sender, EventArgs e) { if (hardwareID == null) { UploadStatusLabel.Text = "You did not specify a HardwareID. Please contact the Administrator.<br />"; } else { //Create directory if it doesnt already exist if (!Directory.Exists(docPath)) { Directory.CreateDirectory(Server.MapPath(docPath)); } } } }