Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 15th, 2009, 11:52 AM
Authorized User
 
Join Date: Mar 2009
Posts: 64
Thanks: 0
Thanked 1 Time in 1 Post
Default Relative URLs

Imar,

I am getting an error message for a project I am working on indicating that the following page cannot be found:

Code:

The resource cannot be found
/~/Setup Facility Department/Reserve User ID.aspx
The link for the page is coded as:

Code:
<a href="~/Setup Facility Department/Reserve User ID.aspx">Setup New Facility or Department</a>
I have the virtual path for the project set to "/".

ASP.NET seems to be adding an additional "/" to the address.

I thought I had followed the steps in the first part of "Chapter 7: Navigation".

Any thoughts?

Thanks.

Thomas
 
Old May 15th, 2009, 12:26 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Thomas,

Take a look at this:

<a href="~/Setup Facility Department/Reserve User ID.aspx">Setup New Facility or Department</a>

You're using the ~ syntax in a client side control which is not allowed. Either remove the ~ or add a runat="server" attribute to the link.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old May 15th, 2009, 01:46 PM
Authorized User
 
Join Date: Mar 2009
Posts: 64
Thanks: 0
Thanked 1 Time in 1 Post
Default

Imar,

when I do that I get:

Code:
arser Error          body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}           p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}          b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}          H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }          H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }          pre {font-family:"Lucida Console";font-size: .9em}          .marker {font-weight: bold; color: black;text-decoration: none;}          .version {color: gray;}          .error {margin-bottom: 10px;}          .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }         Parser Error 

Description:  An error occurred during the parsing of a resource required to service this  request. Please review the following specific parse error details and modify  your source file appropriately. 

Parser Error Message: The file  '/Setup Facility Department/Reserve_User_ID.aspx.cs' does not exist.
I do not remember this being an issue in the book. Perhaps I just do not remember.

Do the spaces in the directory name "Setup Facility Department" make a difference?

Thomas
 
Old May 15th, 2009, 03:08 PM
Authorized User
 
Join Date: Mar 2009
Posts: 64
Thanks: 0
Thanked 1 Time in 1 Post
Default

Imar,

I fixed it. The spaces in the directory name in the aspx and cs file names were the problem. I removed spaces and used an asp:HyperLink and was able to do wonderful things!

Thomas
 
Old May 15th, 2009, 04:40 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Excellent; glad it's working...

Spaces in URLs are never a good idea; not for .NET pages and not for other content....

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic URLs bodenzord Forum and Wrox.com Feedback 2 January 4th, 2005 04:19 PM
Relative URLs? groupmatch BOOK: ASP.NET Website Programming Problem-Design-Solution 21 December 16th, 2004 10:53 AM
urls muhammadtahir4000 HTML Code Clinic 1 December 9th, 2004 04:41 AM
Complex URLs wells XSLT 3 June 16th, 2004 04:17 AM
Automatic URLs Imar Forum and Wrox.com Feedback 13 June 19th, 2003 03:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.