i place using name space in view code behind but i can't call any class of this name space in aspx.
in code behind: using MVCTest.Controller;
i place using name space in view code behind but i can't call any class of this name space in aspx.
in code behind: using MVCTest.Controller;
Did you remember to include the assembly as well? E.g. like this:
// system.web / compilation / assemblies
<add assembly="Microsoft.Web.Mvc"/>
try to use in your aspx / ascx file
<%@ import namespace='your namespace' %>
you could also try to import your namespace in the web.config
<system.web>
<pages>
<namespaces>
<add namespace='you namespace' />
</namespaces>
</pages>
</system.web>
Suppose this is your .Cs file say
namespace MVCTest.Controller {
public class Utility { public static void func1() {} }
}
<%@ import namespace='MVCTest.Controller' %>
Try calling the function by : Utility.func1()