Discussion in 'ASP .Net' started by Brad, Mar 28, 2005.

  1. Brad

    Brad Guest

    I'm attempting to rewrite urls, to point non-aspx pages to aspx page. The
    rewrite code works but once the Application_BeginRequest ends I get a
    NotSupported exception. Running this on win2003 server using 1.1 framework
    and I have mapped the non-aspx to the aspnet_isapi.dll.


    Here is a test example of what I am doing.
    Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal e As

    Dim requestedURL As String =
    Dim newURL As String = ""

    If requestedURL.ToLower.IndexOf(".ctx") > 0 Then
    newURL = requestedURL.Replace(".ctx", ".aspx")
    ElseIf requestedURL.ToLower.IndexOf(".htm") > 0 Then
    newURL = requestedURL.Replace(".htm", ".aspx")
    End If

    If newURL.Length > 0 Then
    End If

    End Sub

    Error message received when I try to browse to something like
    http://localhost/mytest/default.htm or http://localhost/mytest/default.ctx
    The given path's format is not supported.
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.NotSupportedException: The given path's format is
    not supported.

    Source Error:

    An unhandled exception was generated during the execution of the current web
    request. Information regarding the origin and location of the exception can
    be identified using the exception stack trace below.

    Stack Trace:

    [NotSupportedException: The given path's format is not supported.]
    System.Security.Util.StringExpressionSet.CanonicalizePath(String path,
    Boolean needFullPath) +230
    System.Security.Util.StringExpressionSet.AddExpressions(String[] str,
    Boolean checkForDuplicates, Boolean needFullPath) +461

    ess access, String[] pathListOrig, Boolean checkForDuplicates, Boolean
    needFullPath, Boolean copyPathList) +401
    access, String[] pathList, Boolean checkForDuplicates, Boolean needFullPath)
    System.IO.Path.GetFullPath(String path) +82
    physicalPath) +19
    reqPath, IHttpMapPath configmap) +175
    System.Web.HttpContext.GetCompleteConfigRecord(String reqpath,
    IHttpMapPath configmap) +434
    System.Web.HttpContext.GetCompleteConfig() +49
    System.Web.HttpContext.GetConfig(String name) +195
    System.Web.CustomErrors.GetSettings(HttpContext context, Boolean
    canThrow) +20
    System.Web.HttpResponse.ReportRuntimeError(Exception e, Boolean canThrow)
    System.Web.HttpRuntime.FinishRequest(HttpWorkerRequest wr, HttpContext
    context, Exception e) +486
    Brad, Mar 28, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.