P
pawelr74
Hello all,
I'm beginner in c#. In my web application I have class myTool with few
public methods. How can I attached this class to other classes and use
method from myTool class.
In VB I can use Import, but if I try use using in C# I have
Error Message
The type or namespace name 'type/namespace' could not be found (are
you missing a using directive or an assembly reference?)
code:
myTool class is in folder App_Code
public class myTool
{
public int GetIdUser(string UserName)
{
............
}
public void NewUser(string UserName, string Imie, string Nazwisko)
{
.....
}
}
I try use method in class on root application:
using .....
using myTool ; /// error message
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Login1_LoggedIn(object sender, EventArgs e)
{
Session["idUser"] = GetIdUser(Login1.UserName);
}
}
How can I correct my code?
Thanks for yours help
BR.
Pawel
I'm beginner in c#. In my web application I have class myTool with few
public methods. How can I attached this class to other classes and use
method from myTool class.
In VB I can use Import, but if I try use using in C# I have
Error Message
The type or namespace name 'type/namespace' could not be found (are
you missing a using directive or an assembly reference?)
code:
myTool class is in folder App_Code
public class myTool
{
public int GetIdUser(string UserName)
{
............
}
public void NewUser(string UserName, string Imie, string Nazwisko)
{
.....
}
}
I try use method in class on root application:
using .....
using myTool ; /// error message
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Login1_LoggedIn(object sender, EventArgs e)
{
Session["idUser"] = GetIdUser(Login1.UserName);
}
}
How can I correct my code?
Thanks for yours help
BR.
Pawel