I have a publishing custom page layout page and have code something like this -
<ContentPlaceHolder...>
<script runat="server">
void Page_Load(object sender, System.EventArgs e)
{
lblTest.Text = RTG.Business.Helper.开发者_JAVA技巧IsUrlFavorite(Request.Url).ToString();
}
</script>
<asp:Label ID="lblTest" runat="Server" />
</ContentPlaceHolder>
It errors out saying -
The type or namespace name 'Business' does not exist in the namespace 'RTG' (are you missing an assembly reference?)
I have the assembly added to my project and am able to access it from a different user control in this same project. I've tried adding the @Assembly and @Import Namespace tags at the top of the page with no luck.
Does anyone know what I'm doing wrong here?
Assembly, which define "RTG" namespace, need to be placed in GAC. It possible by gacutil.exe, by manually drag to "c:\windows\assembly", But most better case is add it to sharepoint package, for automatic deploying. To do this, open package in solution, click advanced, and add assembly from project output.
Good luck!
精彩评论