Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8428375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:02:17+00:00 2026-06-10T05:02:17+00:00

I need a T4 template or something else to integrate with Visual studio to

  • 0

I need a T4 template or something else to integrate with Visual studio to generate relative path of files in solution.

Is their any add-ins or t4 to this?
I’m working with Visual studio 2012.

something like this:

    public static class Scripts
    {
        public static class AdminSkin
        {
            public static class Css
            {
                public const string Site = "/Scripts/adminskin/css/site.css";
                public const string SiteFa = "/Scripts/adminskin/css/site-fa.css"; 
                public const string Reset = "/Scripts/adminskin/css/reset.css";
                public const string SimpleList = "/Scripts/adminskin/css/simple-lists.css";
                public const string SpecialPages = "/Scripts/adminskin/css/special-pages.css";

            }

            public static class Js
            {
                public const string Site = "/Scripts/adminskin/js/site.js";
                public const string JqueryaccessibleList = "/Scripts/adminskin/js/jquery.accessibleList.js";
                public const string Jquerytip = "/Scripts/adminskin/js/jquery.tip.js";
                public const string List = "/Scripts/adminskin/js/list.js";
                public const string Oldbrowsers = "/Scripts/adminskin/js/old-browsers.js";
                public const string LiveControl = "/Scripts/adminskin/js/live-control.js";
            }
        }

        public static class Calendar
        {
            public static class Js
            {
                public const string Calendar = "/Scripts/calendar/calendar.js";
                public const string CalendarSetup = "/Scripts/calendar/calendar-setup.js";

                public const string CalendarFa = "/Scripts/calendar/calendar-fa.js";
                public const string CalendarEn = "/Scripts/calendar/calendar-en.js";
            }

            public static class Css
            {
                public const string Theme = "/Scripts/calendar/aqua/theme.css";
            }
        }

        public static class HighChart
        {
            public static class Js
            {
                public const string Highstock = "/Scripts/highchart/highstock.js";
                public const string HighstockModified = "/Scripts/highchart/highstock.src.js";
                public const string Theme = "/Scripts/highchart/themes/mytheme.js";
                public const string Exporting = "/Scripts/highchart/modules/exporting.src.js";
            }
        }

        public static class ImageGallery
        {
            public static class Js
            {
                public const string JqueryEasing = "/Scripts/ImageGallery/js/jquery.easing.1.3.min.js";
                public const string JqueryWtRotator = "/Scripts/ImageGallery/js/jquery.wt-rotator.min.js";
                public const string Preview = "/Scripts/ImageGallery/js/preview.js";
            }

            public static class Css
            {
                public const string Preview = "/Scripts/ImageGallery/preview.css";
                public const string JqueryWtRotator = "/Scripts/ImageGallery/wt-rotator.css";
            }
        }

        public static class JQuery
        {
            public static class Js
            {
                public const string JqueryCdn = "http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js ";
                public const string JqueryUiCdn = "http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.20/jquery-ui.min.js";
                public const string JqueryUiCssCdn = "http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.20/themes/ui-lightness/jquery-ui.css";

                public const string JqueryLocal = "/Scripts/jquery/jquery-1.7.min.js";
                public const string JqueryUiLocal = "/Scripts/jquery-ui/js/jquery-ui-1.8.20.custom.min.js";
                public const string JqueryUiCssLocal = "/Scripts/jquery-ui/css/ui-lightness/jquery-ui-1.8.20.custom.css";
            }
        }

        public static class Linq
        {
            public static class Js
            {
                public const string Linq = "/Scripts/linq.js/linq.min.js";
            }
        }


        public static class Moment
        {
            public static class Js
            {
                public const string Moment = "/Scripts/moment/moment.min.js";
            }
        }

        public static class Lang
        {
            public static class Js
            {
                public const string Jalali = "/Scripts/lang/jalali.js";
                public const string LangFa = "/Scripts/lang/lang-fa.js";
            }
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:02:19+00:00Added an answer on June 10, 2026 at 5:02 am

    T4MVC might be what you are looking for. It is a T4 template for ASP.NET MVC apps that will create strongly typed helpers. It will generate a set of classes that you can use instead of using strings. For static files such as javascript files there will be a set of classes such as:

    Links.Scripts.jquery_validate_js
    

    This will return a string of the form “~/Scripts/jquery.validate.js”.

    For a WebForms project David Ebbo created a simple T4 template called AspPathGuru.tt. This currently only supports .aspx, .ascx and .master files. However if you edit the IgnoreFile method, as shown below, you can generate code for other files:

    bool IgnoreFile(FileInfo file) {
        // Only look for a few specific extensions
        switch (file.Extension.ToLowerInvariant()) {
            case ".aspx":
            case ".ascx":
            case ".js":
            case ".css":
            case ".master":
                return false;
        }
    
        return true;
    }
    

    This will generate a Paths class you can use as shown below:

    Paths.Scripts.jquery_1_4_1_js
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create a content presenter template and integrate it into webcenter. But
I need to adapt my template to mobile versions, without creating different page files
I've defined a DataTemplate in a ResourceDictionary. The template need some data (for populating
I need very basic template engine, which is incapsulated in single class. So I
I'm writing an XSLT template that need to output a valid xml file for
In my Django template I need to return the index of an item in
I need to create a Word template where I can choose from different paragraphs
Need to be able to pull Magento products into an external template. Need to
I need a link in django template which turns into logout if user is
I need to achieve some kind of extensibility for a custom project template. Having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.