I'm trying to use an image in my custom module to direct to another control via EditURL. The gridview works perfectly wiith a Hyperlink until I add the ImageURL parameter. This is on a 4.0.2 version system. It then gives me this error:
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /dev_dnn/Default.aspx
And flags two errors each time in the logs:
7/9/2006 7:42:49 PM General Exception AssemblyVersion: 04.00.02; Method: DotNetNuke.HttpModule ... |
AssemblyVersion: 04.00.02 Method: DotNetNuke.HttpModules.UrlRewriteModule.OnBeginRequest FileName: FileLineNumber: 0 FileColumnNumber: 0 PortalID: -1 PortalName: UserID: -1 UserName: ActiveTabID: -1 ActiveTabName: AbsoluteURL: /dev_dnn/Default.aspx AbsoluteURLReferrer: ExceptionGUID: f346bf7b-bca9-415e-8706-93a1d904bfcf DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider InnerException: Unhandled Error: Message: System.Exception: Unhandled Error: ---> System.Web.HttpException: Not Found at DotNetNuke.HttpModules.UrlRewriteModule.OnBeginRequest(Object s, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) --- End of inner exception stack trace ---
| |
7/9/2006 7:42:49 PM Page Load Exception host AssemblyVersion: 04.00.02; Method: System.Web.Util.UrlPa ... |
AssemblyVersion: 04.00.02 Method: System.Web.Util.UrlPath.ReduceVirtualPath FileName: FileLineNumber: 0 FileColumnNumber: 0 PortalID: 0 PortalName: My Website UserID: 1 UserName: host ActiveTabID: 57 ActiveTabName: Test AbsoluteURL: /dev_dnn/Default.aspx AbsoluteURLReferrer: ExceptionGUID: 238287e0-e57d-4b86-96d0-9ed15e417c8b DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider InnerException: Cannot use a leading .. to exit above the top directory. Message: DotNetNuke.Services.Exceptions.PageLoadException: Cannot use a leading .. to exit above the top directory. ---> System.Web.HttpException: Cannot use a leading .. to exit above the top directory. at System.Web.Util.UrlPath.ReduceVirtualPath(String path) at System.Web.Util.UrlPath.Reduce(String path) at System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative) at System.Web.UI.Control.ResolveClientUrl(String relativeUrl) at System.Web.UI.WebControls.Image.AddAttributesToRender(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.WebControls.HyperLink.RenderContents(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.WebControls.TableCell.RenderContents(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.WebControls.Table.RenderContents(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) at System.Web.UI.WebControls.GridView.Render(HtmlTextWriter writer, Boolean renderPanel) at System.Web.UI.WebControls.GridView.Render(HtmlTextWriter writer) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl(HtmlTextWriter writer) at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) at System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) at System.Web.UI.Control.Render(HtmlTextWriter writer) at DotNetNuke.Entities.Modules.PortalModuleBase.Render(HtmlTextWriter output) at System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) at System.Web.UI.Control.RenderControl........ (more follows) | |
Here's the ascx page code:
<
asp:HyperLink ID="enrollmentView" runat="server" NavigateUrl='<%# EditUrl("ItemID", Eval("ItemID").ToString(), "ViewEnrollment") %>' ImageUrl="~/DesktopModules/PDSessions/images/view.gif"></asp:HyperLink>
I'm lost as to why the addition of an ImageURL in the tag causes this - VS2005 validates it and builds the page without any problems, but DNN is acting as if I'm referencing a file outside of the root.
Does anyone have any idea of a fix? Thanks in advance...