When I try to search the website I am getting "Illegal characters in path" error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JacobGoredema
    New Member
    • Nov 2014
    • 1

    #1

    When I try to search the website I am getting "Illegal characters in path" error

    Hi,

    When I try to search my website i am getting the following error. Illegal characters in path highlighting doc.Load(url);

    Here is my code:
    Code:
    public ActionResult Index()
    {
        string url = ConfigurationManager.AppSettings.Get("SearchBloxServer") + "?col=" + ConfigurationManager.AppSettings.Get("SearchBloxCollectionID") + "&" + HttpContext.Request.QueryString.ToString();
    
        ViewBag.TransformSource = "~/upload/xsl/default.xsl";
        XmlDocument doc = new XmlDocument();
        doc.Load(url);
    
        return View(doc);
    }
    Last edited by Frinavale; Nov 19 '14, 03:15 PM. Reason: Added code tags.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    That's a pretty clear error message, you have characters in the doc variable that are illegal. Get rid of the illegal characters and it should work fine.

    Comment

    Working...