I have an issue when I’m trying to make my image or label visible in my web app.
using System;
using System.Linq;
using System.Web.Security;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web.Services;
using System.IO;
using System.Web.UI.Adapters;
public partial class Admin : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Timer1_Tick(object sender, EventArgs e)
{
if (File.Exists("c:/test.pdf"))
//inform user
Console.WriteLine("File uploaded.");
Image1.visible = true;
I’m getting an error as follows:
The name 'Image1' does not exist in the current context
Any ideas here? Ive done this before without issue, but for some reason it doesn’t like the image1 (which i put on my webpage and made visible = false) nor the label which is also visible = false.
Make sure that Image1 is declared “protected”, also make sure that Image1 is the id=”” for the runat=”sever” control on the page.
If neither of these work, try making a trivial change to the markup to recompile the whole page class.