Monday, December 31, 2012

regular expression rewrite path


  Match match = Regex.Match(origPath, @"([^/]*)/member/([^/]*)/([0-9]+)\.aspx$", RegexOptions.IgnoreCase);
        if (match.Success)
        {
            string pageID = match.Groups[3].Value;
            //Context.Response.Redirect("ViewMember.aspx?id=" + pageID);
            Context.RewritePath("../../ViewMember.aspx?id=" + pageID);
        }

No comments:

Post a Comment