Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4.5 > BOOK: Beginning ASP.NET 4.5 : in C# and VB
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #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: 100%
Activity: 100% Activity: 100% Activity: 100%
 
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.
Reply With Quote
  #2 (permalink)  
Old August 4th, 2017, 03:03 PM
Imar's Avatar
Wrox Author
Points: 71,154, Level: 100
Points: 71,154, Level: 100 Points: 71,154, Level: 100 Points: 71,154, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,943
Thanks: 79
Thanked 1,554 Times in 1,531 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!
Reply With Quote
  #3 (permalink)  
Old August 4th, 2017, 03:13 PM
Imar's Avatar
Wrox Author
Points: 71,154, Level: 100
Points: 71,154, Level: 100 Points: 71,154, Level: 100 Points: 71,154, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,943
Thanks: 79
Thanked 1,554 Times in 1,531 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!
Reply With Quote
  #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: 100%
Activity: 100% Activity: 100% Activity: 100%
 
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
Reply With Quote
  #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: 100%
Activity: 100% Activity: 100% Activity: 100%
 
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.
Reply With Quote
  #6 (permalink)  
Old August 11th, 2017, 06:47 AM
Imar's Avatar
Wrox Author
Points: 71,154, Level: 100
Points: 71,154, Level: 100 Points: 71,154, Level: 100 Points: 71,154, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,943
Thanks: 79
Thanked 1,554 Times in 1,531 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!
Reply With Quote
  #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: 100%
Activity: 100% Activity: 100% Activity: 100%
 
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


-----------------------
Reply With Quote
  #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: 100%
Activity: 100% Activity: 100% Activity: 100%
 
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..
Reply With Quote
  #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: 100%
Activity: 100% Activity: 100% Activity: 100%
 
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..
Reply With Quote
  #10 (permalink)  
Old August 12th, 2017, 04:23 AM
Imar's Avatar
Wrox Author
Points: 71,154, Level: 100
Points: 71,154, Level: 100 Points: 71,154, Level: 100 Points: 71,154, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,943
Thanks: 79
Thanked 1,554 Times in 1,531 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!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 07: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 05: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 03:22 AM



All times are GMT -4. The time now is 05:25 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.