I usually include my namespaces e.g.
using myProject.Model;
to my .cs files
but when i want to iterate an object derived from myProject.Model in my .aspx file i must always include the directive
<%@ Import Namespace="myProject.Model" %>
Why is that? I mean if it is declared in code behind file (in default.aspx.cs) of default.aspx Why should i add it again? Why it is not available?
Just wondering but i would like to know why is that.
Thank you in advance!
You can add a namespaces element to your web.config to specify namespaces that you’d like to be imported automatically.