p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 4.5 : in C# and VB (http://p2p.wrox.com/forumdisplay.php?f=710)
-   -   $relurlnamespace$_$safeitemname$ Not working (http://p2p.wrox.com/showthread.php?t=99592)

Phil Whiteley July 31st, 2017 06:01 PM

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

Imar August 4th, 2017 03:03 PM

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 August 4th, 2017 03:13 PM

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

Phil Whiteley August 8th, 2017 05:55 PM

Quote:

Originally Posted by Imar (Post 309189)
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

Phil Whiteley August 9th, 2017 06:53 PM

Also, I am not getting a email when you post an answer.

Imar August 11th, 2017 06:47 AM

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

Phil Whiteley August 11th, 2017 07:44 AM

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


-----------------------

Phil Whiteley August 11th, 2017 07:57 AM

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

Phil Whiteley August 11th, 2017 08:38 PM

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

Imar August 12th, 2017 04:23 AM

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


All times are GMT -4. The time now is 01:39 AM.

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