davidebbo / davidebbo.github.io

4 stars 14 forks source link

Changing the ProcessVirtualPathDefault method to keep the Tilde has unwanted side-effects. #33

Closed jordangurney closed 9 years ago

jordangurney commented 9 years ago

Hey,

I just wanted to give you my utmost and sincere praise for T4 MVC. I know it's been out for a while, but it's new to me, and I've just about replaced every single "Magic string" in my entire web application (and it's large) to T4 MVC. I'm using it at https://jgportal.com.

However, I did have one question: I modified the ProcessVirtualPathDefault(string virtualPath) method to include the ASP.NET tilde, because I wanted to use the Links.Content.css.whatever_css inside of my BundleConfig.cs file for css and JS bundling. And that file NEEDS the tilde. However, when I use the @Links.Content... in my VIEWS, the tilde is there and ASP.NET doesn't get a chance to resolve it before it hits the browser, and then the browser doesn't know what to do with it. The resource is thus, not found until the tilde is removed. Right now, I'm solving it in a really sloppy way, I wrote an extension method that trims off of the character of the string if it's a tilde for the VIEWS, but do you have a more elegant solution? Surely this is something others (even yourself) have run into before???

Thanks! I'm truly a fan of this tool! Love it! You can email me back at jordangurney@gmail.com or replay at https://jgportal.com/ContactUs Jordan

davidebbo commented 9 years ago

Glad you like T4MVC! :)

Would you mind re-posting your question to https://github.com/T4MVC/T4MVC instead? That one, it's more likely to be seen by others interested in T4MVC, whereas no one else will see it here. Thanks!