I've been following the Seabury Design videos on creating a custom
module (good work, Todd! Thx!) All the code in the C# code-behind
file has worked great, however, I can't get the EditURL() method call
to work from HTML. In the video, he copied the following code
from the FAQs.ascx and pasted it into the .ascx file for the new module
(this is the code which displays the edit link as the pen icon):
<asp:HyperLink NavigateUrl='<%#
EditURL("ItemID",DataBinder.Eval(Container.DataItem,"ItemID")) %>'
Visible="<%# IsEditable %>" runat="server"
ID="Hyperlink1"><asp:Image ID=Hyperlink1Image Runat=server
ImageUrl="~/images/edit.gif" AlternateText="Edit"
Visible="<%#IsEditable%>"
resourcekey="Edit"/></asp:hyperlink>
All we need to do is change the two occurrences of ItemID to whatever
our key field is. But it blows up in the browser. I
whittled it down to just this:
<asp:HyperLink NavigateUrl='<%#
EditURL("foo","22") %>' runat="server"
ID="Hyperlink1">-link-</asp:HyperLink>
But this also blows up (and just including the code to display the pen
icon also blows up), here's the stacktrace in the browser:
Unhandled error loading module.
DotNetNuke.Services.Exceptions.ModuleLoadException:
External component has thrown an exception. --->
System.Web.HttpException: External component has thrown an exception.
---> System.Web.HttpCompileException: External component has thrown
an exception. at
System.Web.Compilation.BaseCompiler.ThrowIfCompilerErrors(CompilerResults
results, CodeDomProvider codeProvider, CodeCompileUnit sourceData,
String sourceFile, String sourceString) at
System.Web.Compilation.BaseCompiler.GetCompiledType() at
System.Web.UI.UserControlParser.CompileIntoType() at
System.Web.UI.TemplateParser.GetParserCacheItemThroughCompilation() ---
End of inner exception stack trace --- at
System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean
fCreateIfNotFound) at System.Web.UI.TemplateParser.GetParserCacheItem()
at
System.Web.UI.TemplateControlParser.CompileAndGetParserCacheItem(String
virtualPath, String inputFile, HttpContext context) at
System.Web.UI.TemplateControlParser.GetCompiledType(String virtualPath,
String inputFile, HttpContext context) at
System.Web.UI.UserControlParser.GetCompiledUserControlType(String
virtualPath, String inputFile, HttpContext context) at
System.Web.UI.TemplateControl.LoadControl(String virtualPath) at
DotNetNuke.UI.Skins.Skin.InjectModule(Control objPane, ModuleInfo
objModule, PortalSettings PortalSettings) --- End of inner exception
stack trace ---
BTW, here's the directive for my user control (since I suspect that may be involved):
<%@ Control Language="c#"
AutoEventWireup="false" Codebehind="AI_Blog.ascx.cs"
Inherits="AbstractInstance.DNN.Modules.AI_Blog.AI_Blog" %>
Any ideas, folks? Thx for helping out a DNN newbie!
-Pete