locked
Unexpected change of text in aspx page contained in template RRS feed

  • Question

  • User695372294 posted

    I have created an ASP.NET project based on the VB.Net Web Forms version of Microsoft's ASP.NET Web Application template and edited to suit my needs.

    This project is called MyWebApplicationTemplateMaster and it is dedicated to the sole purpose of exporting a custom template called MyWebApplicationTemplate, which I intend to use for creating new web applications. The Default.aspx page in MyWebApplicationTemplateMaster contains a reference to the fact that MyWebApplicationTemplateMaster is the source for my template. 

    However, when I tested this by creating a new project in VS 2019 called MyTestProject based on the MyWebApplicationTemplate, that reference on Default.aspx to 'MyWebApplicationTemplateMaster' was changed to 'MyTestProject'. How do I stop this unwanted text substitution?

    Friday, September 25, 2020 9:56 PM

Answers

All replies

  • User409696431 posted

    You should expect the new project name to be used for the main namespace.  If you create the template correctly, that won't break anything: it will substitute everywhere it needs to.  This is the same behavior you'll see when you create a project from one of the supplied templates.

    How to create project templates: https://docs.microsoft.com/en-us/visualstudio/ide/how-to-create-project-templates?view=vs-2019

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 27, 2020 1:10 AM
  • User695372294 posted

    Hi Kathy,
    I always expected that the new project name would be used in all the important places when exploiting a template but I can't see anything in that Microsoft document that refers to text substitution in ordinary page content. I guess there must be a blanket substitution for all references to the originating project name rather than "everywhere it needs to".

    It's not a major problem, but it means that I have to be a little creative when including a reminder in my templates of the project from which they were exported.

    As always, many thanks for your assistance  :)

    Sunday, September 27, 2020 10:14 AM