As i understand, i can import only namespace to ended file in the path:
<%@ Import namespace="Project.Web.Localization.Shared" %>
and now i can use like this <%:LogOnUserControl.Account%>
So now i am try to refactor my code to much general
Import Namespace in ascx don't work
-
02-06-2022 - |
Frage
<%@ Import namespace="Project.Web.Localization" %>
<%:Shared.LogOnUserControl.Account%>
I try this to make shorter my code :), but it didn't work :(
ASP didn't find folder Shared.
but this is working <%:Project.Web.Localization.Shared.LogOnUserControl.Account%>
Lösung 2
Andere Tipps
You need to look into this and this .
This is complete namespace Project.Web.Localization.Shared.LogOnUserControl.Account
This can be a namespcae Project.Web.Localization
but this ain't Shared.LogOnUserControl.Account
. You are trying to break the property of Import
called namespace
which is illegal syntax . Or you can use web.config
like described here
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow