code avec namespace ne marche pas.
Bonjour
Ce code marche correctement (website form application dans Visual Studio):
Code:
1 2 3 4 5 6 7 8 9
| using System;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
int j = 6;
Label1.Text = "ok " + j.ToString();
}
} |
Ce code donne cette erreur:
Citation:
Label1 doesn't exist in this context.
Pourquoi? (Label1 existe bien dans la page aspx).
Merci.
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| using System;
namespace test
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
int j = 6;
Label1.Text = "ok " + j.ToString();
}
}
} |