 |
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
|
|
|
|

July 31st, 2017, 06:01 PM
|
Registered User
|
|
Join Date: May 2016
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
$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.
|

August 4th, 2017, 03:03 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|

August 4th, 2017, 03:13 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|

August 8th, 2017, 05:55 PM
|
Registered User
|
|
Join Date: May 2016
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by Imar
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
|

August 9th, 2017, 06:53 PM
|
Registered User
|
|
Join Date: May 2016
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Also, I am not getting a email when you post an answer.
|

August 11th, 2017, 06:47 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|

August 11th, 2017, 07:44 AM
|
Registered User
|
|
Join Date: May 2016
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
-----------------------
|

August 11th, 2017, 07:57 AM
|
Registered User
|
|
Join Date: May 2016
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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..
|

August 11th, 2017, 08:38 PM
|
Registered User
|
|
Join Date: May 2016
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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..
|

August 12th, 2017, 04:23 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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
|
|
 |
|