Can I use Extension Methods inline in an ASPX page?

╄→гoц情女王★ 提交于 2019-12-04 00:36:35
Michael Haren

Try closing the .aspx page and opening it up again as per this answer. If that improves things at all (e.g. enable intellisense) but doesn't solve it, please post any new errors you get.

You could also add the Public modifier to your Module or class definition. If you're using Modules, it really doesn't make sense to me that it would be required, but some discussion on this forum indicates that it might help.

Adding imports in the namespace works for me!

<%@ Import Namespace="Foo.FooFoo" %>

If it's working in the codebehind, add the namespace to the function call:

<%=MyNamespace.ExtensionFcn("hello, world") %>

I'd do this before I'd modify the web.config.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!