Hi
this code gives the error "Label1 is inaccessible due to its protection level" in the line in bold. How can i fix that?
Thanks
V
aspx file
Code
...
...code-behind
C#
using System; using System.Web.UI;
namespace tijdrit
{
public partial class Tijdrit : Page
{
public names = "Bob";
}
class Test
{
protected void Page_Load(object sender, EventArgs e)
{
Tijdrit tr = new Tijdrit();
tr.Label1.Text = tr.names;
}
}
}
Valerie MeunierRank #1,527 · 1K reputationPosted Dec 30, 2022, 6:20 AM EST
Sorry, I found it. I have to go to the Designer.cs file and change protected in public.