Rotten Virtual Path Error

Topics: Developer Forum, User Forum
Feb 4, 2009 at 7:59 PM
Hi (again), I blew up my website, by typing in an incorrect virtal path and now the site seems permanently boken, I've spent 12 hours and went through every file on the server to try and figure out how to correct, what is no more than a typo when it comes down to it, listed below (at the bottom) is the full error message. I went to the App_Code\Form.cs but that doesn't seem to help, I then found a file where I actually saw the incorrect path name, so I changed it, the file was in: App_Data\Pages\cf490459-515c-4608-a4e4-c7869ebf1814.config  The code is here:


<?xml version="1.0"?>
<WebPageData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Visible>true</Visible>
  <AllowAnonymousAccess>true</AllowAnonymousAccess>
  <EditPowerUser>false</EditPowerUser>
  <VirtualPath>~/forum.aspx</VirtualPath>
  <NavigationName>Forum</NavigationName>
  <Title>Forum</Title>
  <Description>Forum</Description>
  <Keywords>Forum</Keywords>
  <Sections>
    <string>a2047ca4-660f-4c37-bf88-6a58a15c8c0f</string>
  </Sections>
</WebPageData>


As you can see I changed ~/http://www.wsaag.org/gravitypush/index.php.aspx to  ~/forum.aspx which is correct, but that still keeps giving me the same main error message below. I can't locate the string, <string>a2047ca4-660f-4c37-bf88-6a58a15c8c0f</string> if I need to, perhaps the error is recorded inside the string, but where is the string, I've looked everywhere that I can see. Can anyone please help me with any suggestions as to how I can fix the problem. The problem occured when I went into the administration section and pasted ~/http://www.wsaag.org/gravitypush/index.php over the top of ~/forum.aspx in the Virtual path section, I was trying to see if a user could click directly onto the new page heading and go to an outside website instead of a page within my own website. Too see the actual error live, my URL is http://tailwag.info

Thanks in advance for any help.
 Regards Ron. 

Server Error in '/' Application.

'~/http://www.wsaag.org/gravitypush/index.php.aspx' is not a valid virtual path.

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.Web.HttpException: '~/http://www.wsaag.org/gravitypush/index.php.aspx' is not a valid virtual path.

Source Error:

Line 23:         protected override void Render(System.Web.UI.HtmlTextWriter writer)
Line 24:         {
Line 25: base.Render(new RewriteFormHtmlTextWriter(writer));Line 26:         }
Line 27:     }

Source File: d:\hosting\tailwags\App_Code\Form.cs    Line: 25

Stack Trace:

[HttpException (0x80004005): '~/http://www.wsaag.org/gravitypush/index.php.aspx' is not a valid virtual path.]
   System.Web.Util.UrlPath.CheckValidVirtualPath(String path) +820707
   System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative) +150
   System.Web.UI.Control.ResolveClientUrl(String relativeUrl) +296
   System.Web.UI.WebControls.MenuItem.RenderItem(HtmlTextWriter writer, Int32 position, Boolean enabled, Orientation orientation, Boolean staticOnly) +1867
   System.Web.UI.WebControls.Menu.RenderContents(HtmlTextWriter writer, Boolean staticOnly) +2583
   System.Web.UI.WebControls.Menu.Render(HtmlTextWriter writer) +225
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
   System.Web.UI.Control.Render(HtmlTextWriter writer) +7
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +7
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +59
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +68
   System.Web.UI.Adapters.ControlAdapter.Render(HtmlTextWriter writer) +18
   MyWebPagesStarterKit.FormRewriterControlAdapter.Render(HtmlTextWriter writer) in d:\hosting\tailwags\App_Code\Form.cs:25
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +2116097
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +37
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
   System.Web.UI.Control.Render(HtmlTextWriter writer) +7
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +199
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +20
   System.Web.UI.Page.Render(HtmlTextWriter writer) +26
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2558
 
Feb 5, 2009 at 7:46 AM
Ron,

The URL is held in two places - one in the page file and one in the Web.sitemap file in App_Data.

You need to edit both of these. In your case drop the '~/' from the front and the '.aspx' from the end to give http://www.wsaag.org/gravitypush/index.php

Every time you use the admin navigation page to edit the page details the problem will return as valVirtualPath_ServerValidate in Administration\Navigation.asp.cs ensures the virtual path is as you see it now. You could edit this code to stop this behaviour.

I believe there was a previous thread about this.

Regards

Paul Gardner

Feb 5, 2009 at 7:58 AM
Hi Paul,

Thanks for your terrific suggestions, but I decided that seeing I spent about 12 hours trying to find where it was held and failed, that it would be quicker to blow the entire site away, upload all new files and simply start again, and this time take care when typing in url's in Virtual Paths. The upside is that I grabed the latest version from the server, so it's not all a negative :-)

Thanks again Paul.
Cheers

Ron
 
May 8, 2009 at 5:45 PM

Just wanting to recap, when I create a new menu item that points to another website and someone clicks on it, they will be transported to the other website providing I type the correct URL. Currently if creating a webpage for my own site I use the ~/ before the page name, for example an about.aspx page would be entered into the Virtual Path section as ~/about.aspx - are you saying that if I entered something like this into the virtual path: http://www.mywebsite.com/story.aspx that when a user clicked on the menu item About, that he would go to a website called mywebsite to the page story.aspx ?

My probelem with not wanting to try this is that the last time I did it I broke the site completely. I see that a full URL is not a Virtual path and I'm wondering if indeed you can add a proper URL into a place that is expecting a virtual path?

I don't have any old sample website that I can break (trial it on), so I really need to know if I'm on the right track. Plus, assuming that you can do it, how could you get it to open a new instance of the browser as opposed to simply opening the new site in the existing browser, could you use the _blank syntax?

So many questions, so few answers :-)

Regards

Ron