Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : in C# and VB 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
  #1 (permalink)  
Old July 31st, 2017, 06:01 PM
Registered User
Points: 32, Level: 1
Points: 32, Level: 1 Points: 32, Level: 1 Points: 32, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2016
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default $relurlnamespace$_$safeitemname$ Not working

Hi
Page 213 - reusable template. Ok till I try and use the template - many errors but mainly because the class name ends up being "_$safeitemname". So not translated.

Seems a general problem. Please advise solution.
  #2 (permalink)  
Old August 4th, 2017, 03:03 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Phil,

Sorry for the late reply; I was away on vacation.

Is this still an issue? If so, can you post the code you used in your template? It would be best to open the ZIP file in your Documents folder) and then copy and past the code for the code behind class. It sounds like you have a typo somewhere that prevents the class name from being set correctly.

Cheers,

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!
  #3 (permalink)  
Old August 4th, 2017, 03:13 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Phil,

Sorry for the late reply; I was away on vacation.

Is this still an issue? If so, can you post the code you used in your template? It would be best to open the ZIP file in your Documents folder) and then copy and past the code for the code behind class. It sounds like you have a typo somewhere that prevents the class name from being set correctly.

Cheers,

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!
  #4 (permalink)  
Old August 8th, 2017, 05:55 PM
Registered User
Points: 32, Level: 1
Points: 32, Level: 1 Points: 32, Level: 1 Points: 32, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2016
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
Hi Phil,

Sorry for the late reply; I was away on vacation.

Is this still an issue? If so, can you post the code you used in your template? It would be best to open the ZIP file in your Documents folder) and then copy and past the code for the code behind class. It sounds like you have a typo somewhere that prevents the class name from being set correctly.

Cheers,

Imar
Hi Imar,

Could you just try your code? Open the Source/Chapter07 site - create a new page based on the MyBasePage - when you go to run it you should see the issue.

As I recall I have the same problem last time I tries it 12 mths ago..

Phil
  #5 (permalink)  
Old August 9th, 2017, 06:53 PM
Registered User
Points: 32, Level: 1
Points: 32, Level: 1 Points: 32, Level: 1 Points: 32, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2016
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Also, I am not getting a email when you post an answer.
  #6 (permalink)  
Old August 11th, 2017, 06:47 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I just tried it and it works fine for me; just as the book describes.

That's why I asked for your code; you must be making a typo or some other mistake somewhere. Can you send me the ZIP file for the exported template?

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!
  #7 (permalink)  
Old August 11th, 2017, 07:44 AM
Registered User
Points: 32, Level: 1
Points: 32, Level: 1 Points: 32, Level: 1 Points: 32, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2016
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok - I accept what you are saying - it must something else.

Note: I am using the 4.5.1 code & book- sorry if I posted in the wrong area..

There is no code to send - I am using your source chapter07.
On page 215 I do the exact instructions 9 & 10 - see errors below..

I have the latest software.

Microsoft Visual Basic 2017
ASP.NET and Web Tools 2017 15.0.30503.0
ASP.NET and Web Tools 2017

Perhaps I have not installed a package I need? I have attached the TestPage files..

Also - I AM STILL NOT GETTING AN EMAIL WHEN YOU POST?

Thanks
Phil

Errors
----------------------
Severity Code Description Project File Line Suppression State
Error CS1061 '_TestPage' does not contain a definition for 'Context' and no extension method 'Context' accepting a first argument of type '_TestPage' could be found (are you missing a using directive or an assembly reference?) 4_TestPage.aspx C:\Users\phil\Desktop\Chapter07\TestPage.aspx 1 Active
Error CS1061 '_TestPage' does not contain a definition for 'Context' and no extension method 'Context' accepting a first argument of type '_TestPage' could be found (are you missing a using directive or an assembly reference?) 4_TestPage.aspx C:\Users\phil\Desktop\Chapter07\TestPage.aspx 1 Active


-----------------------
  #8 (permalink)  
Old August 11th, 2017, 07:57 AM
Registered User
Points: 32, Level: 1
Points: 32, Level: 1 Points: 32, Level: 1 Points: 32, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2016
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What seems to be happenning is that the class file is not being substituted properly. This is what I get:

public partial class _$safeitemname : BasePage << if I name it correctly it looks ok..
  #9 (permalink)  
Old August 11th, 2017, 08:38 PM
Registered User
Points: 32, Level: 1
Points: 32, Level: 1 Points: 32, Level: 1 Points: 32, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2016
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well ok - seems there is no answer- I have provided the error codes and assure you with my setup and your files - it does not work..
  #10 (permalink)  
Old August 12th, 2017, 04:23 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, you have posted the error codes and setup. However, those are the result from the template file you have created. The issue is with the template itself, not with the file created from it. I think you made a typo when creating the template.

So: once more: if you post the code from the template file (you should post the markup and the code behind from the aspx file inside the ZIP file) or send me the actual ZIP file (which you should find under Templates\Item Templates somewhere inside your Documents folder) by email, I'll take a look and hopefully point you to the issue.

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
$relurlnamespace$ template parameter maxpowernz BOOK: Beginning ASP.NET 4 : in C# and VB 1 August 19th, 2015 03:21 PM
$relurlnamespace$ rah132 BOOK: Beginning ASP.NET 4 : in C# and VB 2 February 19th, 2013 08:36 PM
Chapter 17 Page 609: $safeitemname$ issue? AlexGrab BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 December 31st, 2010 06:06 AM
Web.Config..Working or Not Working peace95 ASP.NET 1.0 and 1.1 Basics 1 September 18th, 2006 06:53 AM
Local COM working , but not working at Web Serv nagen111 .NET Web Services 3 February 19th, 2005 04:22 AM





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