Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
320
e.Item.NavigateUrl and additional address bar arguments
posted

I'm binding this control to a  database which contains

~/Reports/Specimens/SpecimenReports.aspx?ReportName=DetailedSubmissionLog

When a user clicks on the item containing this url an error is generated

HttpException (0x80004005): '~/Reports/Specimens/SpecimenReports.aspx?ReportName=DetailedSubmissionLog' is not a valid virtual path.]
   System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options) +8855707
   System.Web.VirtualPathUtility.ToAbsolute(String virtualPath) +12
   Infragistics.Web.UI.NavigationControls.NavItem.get_ResolvedNavigateUrl() +110
   Infragistics.Web.UI.NavigationControls.DataMenuRenderer.RenderItem(DataMenuItem item, DataMenuItemCollection items, HtmlTextWriter writer, Boolean isHorizontal) +1547
   Infragistics.Web.UI.NavigationControls.DataMenuRenderer.Renderitems(DataMenuItemCollection items, HtmlTextWriter writer) +588
   Infragistics.Web.UI.NavigationControls.DataMenuRenderer.RenderContents(HtmlTextWriter writer) +1611

What am I doing wrong?

 

Parents
No Data
Reply
  • 3726
    Verified Answer
    posted

    Hi,

    just check the URL that comes from the database, to make sure that it is correct. The MSDN documentation states that ToAbsolute() will throw HttpException when "A leading double period (..) is used to exit above the top directory."

    I tried the following code:

    protected internal string ResolvedNavigateUrl
    {
    get
    {
    if (NavigateUrl != null && NavigateUrl.Trim().IndexOf("~/") == 0)
    {
    return VirtualPathUtility.ToAbsolute(NavigateUrl);
    }
    return NavigateUrl;
    }
    }

    this.NavigateUrl = "~/Reports/Specimens/SpecimenReports.aspx?ReportName=DetailedSubmissionLog";
    string s = this.ResolvedNavigateUrl;

    and s has the value  "/Reports/Specimens/SpecimenReports.aspx?ReportName=DetailedSubmissionLog"

    Thanks,

    Lubomir

Children