Rose debug info
---------------

Класс не работает ((

Engineer.cs

using System;
using System.Collections.Generic;
using System.Web;

public class Engineer
{
    public string EmployeeID { get; set; }
    public string FIO { get; set; }
    public int WorkTime { get; set; }

    public string test = «TEST VALUE»;

    public Engineer()
    {

    }
}

Default.aspx.cs

void test1()
{
Engineer eng = new Engineer();
Label1.Text = eng.test;
}

Description: An  error occurred during the compilation of a resource required to service this request. Please review the following specific error details and  modify your source code appropriately.

Compiler Error Message: CS1061: ’Engineer’ does not  contain a definition for ’test’ and no extension method ’test’ accepting a first argument of type ’Engineer’ could be found (are you missing a  using directive or an assembly reference?)

 38   2011  
5 комментариев
Alex 2011

eng.test.toString();

Alex 2011

или

public string test1()
{
Engineer eng = new Engineer();
//Label1.Text = eng.test;
return eng.test;
}

а в

public partial class Default_test : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Engineer eng = new Engineer();
Label1.Text = eng.test1();
}
}

хотя у меня и так и так работает

Alex 2011

еще к Default.aspx.cs класс подключил?

admin 2011

Да, разобрался я что было =) Оказывается в проекте была страница Engineer.aspx и Engineer.aspx.cs соответственно.

Санжар 2011

Интересный ты, ASP.NET DEVELOPER, а сайт то на WordPress)) Еще бы линукс у Била Гейтса стоял бы, я бы вообще с ума сошел...