2011-09-21 61 views
0

在我后面的代码,我可以做以下在onload:asp.net调用代码内嵌不工作

string x = Fmg.Cti.UI.Utilities.Classes.ResourceController.ReadResourceValue("Riblet", "Riblet_Chicklet1_Button_text"); 

这工作没有问题。

在我的aspx页面(我没有删除在onload代码),我把这个:

<%= Fmg.Cti.UI.Utilities.Classes.ResourceController.ReadResourceValue("Riblet", "Riblet_Chicklet1_Button_text")%> 

当我这样做,我得到了一个错误:

error CS0234: The type or namespace name 'Cti' does not exist in the namespace 'Fmg' (are you missing an assembly reference?)

我这个(或者非常相似的)工作。我不知道我是如何破坏它的。

再次感谢您的帮助。

+0

你能证明你的ASPX标记? –

回答

0

是否已导入该名称空间?对于asp.net,您可以执行以下操作来使命名空间可用于内联编码。

<%@ Import Namespace="Fmg.Cti.UI.Utilities.Classes" %> 

您可以命名空间一般可用到所有asp.net页面内联编码通过添加命名空间到web.config中

<system.web> 
    <pages> 
     <namespaces> 
     ... 
     <add namespace="Fmg.Cti.UI.Utilities.Classes" /> 
     ... 
     </namespaces> 
    </pages> 
</system.web>