Questions tagged [t4mvc]

T4MVC is an open source utility for Microsoft ASP.NET MVC. It allows replacing magic strings in Views, Controllers and Links to content with strong names/types.

T4MVC is an open source utility for Microsoft ASP.NET MVC. It allows replacing magic strings in Views, Controllers and Links to content with strong names/types.

Resources

245 questions
8
votes
3 answers

Cannot get T4MVC to work with VS2010 and ASP.NET MVC 2

I'm trying to add the T4MVC templates to my project, but I'm experiencing some problems. I went to Codeplex and downloaded the latest version of T4MVC, and according to the instructions I just copied the two files T4MVC.tt and T4MVC.Settings.t4 into…
Tomas Aschan
  • 58,548
  • 56
  • 243
  • 402
8
votes
1 answer

T4MVC, is it outdated? Still good? If not what else to use?

Folks, As of today should I introduce T4MVC in my project or use strongly typed goodness from MvcContrib? return RedirectToAction(MVC.MyController.MyAction()); or return RedirectToAction(c => c.MyAction()); Trying to stick with…
7
votes
2 answers

How to redirect MVC action without returning 301? (using MVC 4 beta)

I'm working on an ASP.NET MVC solution that has a number of different menus. The menu to display depends on the role of the currently logged in user. In MVC 3 I had some custom code to support this scenario, by having a single controller method that…
Morten Mertner
  • 9,414
  • 4
  • 39
  • 56
7
votes
2 answers

Make T4MVC work with ASP.NET 5

According to the latest comments in this thread, .tt templates will now after all be supported in ASP.NET 5 starting with Visual Studio Update 1. Which IMHO would be great because after using T4MVC for years, I certainly don't wanna go back to…
Max
  • 9,220
  • 10
  • 51
  • 83
6
votes
1 answer

ASP.NET MVC3 How to reference views directly from controller

In my controller I want to specify a different View than default. Like this : public ActionResult EditSurvey(Int32 id) { Survey survey = _entities.Surveys.Single(s => s.Id == id); return View("Survey",survey); } But…
redrobot
  • 835
  • 2
  • 13
  • 30
6
votes
2 answers

AssemblyBinding BindingRedirect not working for MVC4 app with T4MVCExtensions

We have a large .NET web application that was MVC3, using T4MVC. We recently upgraded it to MVC4, and all is good except for T4MVCExtensions (version 3.6.5 from NuGet) is still dependent on System.Web.Mvc version 3. The runtime dependencies that…
Francis Spor
  • 144
  • 2
  • 7
6
votes
4 answers

Regexp-replace: Multiple replacements within a match

I'm converting our MVC3 project to use T4MVC. And I would like to replace java-script includes to work with T4MVC as well. So I need to replace "~/Scripts/DataTables/TableTools/TableTools.min.js" "~/Scripts/jquery-ui-1.8.24.min.js" Into…
trailmax
  • 34,305
  • 22
  • 140
  • 234
6
votes
1 answer

T4MVC OptionalParameter values implied from current context

I've noticed what I believe to be some odd behavior with T4MVC. Specifically, I'm attempting to build an ActionLink (using the HtmlHelper) for an action where the optional parameter value is null. This works fine most of the time. However, if the…
Vinney Kelly
  • 4,975
  • 1
  • 25
  • 31
6
votes
2 answers

MVC extending controller to have ajax-aware Redirect functionality

Hi I am learning Ajax + MVC. I figured it would be nice for the Controller to automatically handle ajax-aware Redirect(). After some digging, I found the code from this link. The code below is totally transparent to user, a user can just call…
Tom
  • 15,781
  • 14
  • 69
  • 111
5
votes
1 answer

Compile error with T4MVC generated code in a MVC 3 project

We are developing a web application with ASP.Net 4 & MVC 3 Framework. I've installed T4MVC through NuGet and all the Views, Controllers and static content are succesfully generated as strong types. But, when I try to compile the project, it raises…
Sergi
  • 391
  • 1
  • 4
  • 10
5
votes
1 answer

T4MVC Use Extension methods in Control Library

I have written a few razor helpers and these helpers use functions that include the extension methods generated by T4MVC. I now want to move these to a control library so that they can be used across multiple mvc applications. The initial idea that…
Dewy
  • 153
  • 5
5
votes
2 answers

T4MVC alternatives for ASP.NET 5?

T4MVC is not supported yet or ever in ASP.NET 5. Is there any other similar solution ? I need strongly typed views and controllers names.
Maciej Wojsław
  • 403
  • 2
  • 10
5
votes
1 answer

T4MVC and duplicate controller names in different areas

In my application I have controller named Snippets both in default area (in application root) and in my area called Manage. I use T4MVC and custom routes, like this: routes.MapRoute( "Feed", "feed/", MVC.Snippets.Rss() ); And I get this…
artvolk
  • 9,448
  • 11
  • 56
  • 85
5
votes
2 answers

T4MVC: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'EnvDTE80.CodeClass2'.

When using T4MVC and attempting to 'Run Custom Tool' I get this: Running transformation: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'EnvDTE80.CodeClass2'. This operation failed because the…
kevin_fitz
  • 837
  • 6
  • 19
5
votes
1 answer

Does Visual Studio 2008 Express support t4?

I'm trying to use T4MVC in Visual Web Developer 2008 Express Edition and it's not building any files. Is T4 supported in the express editions?
C. Ross
  • 31,137
  • 42
  • 147
  • 238
1
2
3
16 17