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
2
votes
1 answer

T4MVC VB with Visual Studio 2010 Express Edition

I am having trouble using T4MVC VB with Visual Studio 2010 Express Edition. I can reference the T4MVC classes in my controllers, but I cannot access them in my views (where I actually need them). In the view, the following code is overwritten by…
C. Ross
  • 31,137
  • 42
  • 147
  • 238
2
votes
2 answers

T4MVC url.action in jquery /view

this may or may not be possible (and could well be in the docs but i've just missed it). How do i structure a Url.Action() inside my view using T4MVC that will allow me to use jQuery selectors. I've been attempting the following (in my javascript)…
jim tollan
  • 22,305
  • 4
  • 49
  • 63
2
votes
1 answer

Removing T4MVC from my VS2010 solution

I'm very new to VS2010, so this is more a question about using Visual Studio 2010 than T4MVC. Anyway, I wanted to remove T4MVC from my solution, so I deleted the two files from my root directory. However, when I rebuild and debug my solution, I…
Mass Dot Net
  • 2,150
  • 9
  • 38
  • 50
2
votes
0 answers

T4MVC: Cannot use a leading .. to exit above the top directory

I'm trying to use the T4MVC project from the MVCContrib project on codeplex (v2.6.13). I'm using ASP.NET MVC 2 RTM running against .NET 4 in Visual Studio 2010. Using the Default project template that you get when creating a new MVC 2 Web…
Gavin Osborn
  • 2,593
  • 3
  • 27
  • 42
2
votes
2 answers

Refactoring a form in MVC2

I find myself pasting this code over and over on many views that deal with forms. Is there a simple approach to refactor the following markup from a view in MVC2? The only changing part is the route for the cancel link (LocalizedSaveButton and…
Robert Dean
  • 3,193
  • 3
  • 25
  • 29
2
votes
0 answers

Path in javascript not loading file

I'm trying to load a gexf file from javascript in my Asp.Net MVC Web Application from inside a View and am not sure why when I run the website, it doesn't find the file I'm looking for even if the path is…
2
votes
1 answer

How do I test rendered views when using T4MVC with TestHelper?

How do I test which view was rendered from a controller action if what I get is a T4MVC_ActionResult? Under normal circumstances I should be able to directly use TestHelper's methods, like in the…
Kenji Kina
  • 2,402
  • 3
  • 22
  • 39
2
votes
1 answer

Using T4MVC and Kendo UI for ASP.NET MVC

How to use T4MVC templates with Kendo UI helpers for ASP.NET MVC? @(Html.Kendo() .Grid() .Name("T4Grid") .Columns(col => { col.Bound(wf => wf.Name); col.Bound(wf => wf.Description); }) .DataSource(src => src …
Neshta
  • 2,605
  • 2
  • 27
  • 45
2
votes
5 answers

Rendering a JsonResult to a string in Razor

I have a server-generated object that I need to convert to a JSON object for JavaScript to consume. I prefer to render this JSON object directly into a JS variable when the view renders to prevent an additional HTTP request. This is in my…
Chris Barr
  • 29,851
  • 23
  • 95
  • 135
2
votes
1 answer

T4MVC not generating an action

I suspected there was some hidden magic somewhere that stopped what looks like actual method calls all over the place in T4MVC. Then I had a view fail to compile, and the stackTrace went into my actual method. [Authorize] public string…
Maslow
  • 18,464
  • 20
  • 106
  • 193
2
votes
2 answers

Does T4MVC support WebApi?

I'm trying to use T4MVC to create strongly typed links to WebApi endpoints, and while it does generate helpers for my ApiControllers, there's no method for creating links. The generated controllers have ViewNames, but no action methods. I guess…
Joshua Frank
  • 13,120
  • 11
  • 46
  • 95
2
votes
1 answer

How can I get T4MVC to work with a route like "{controller}/{action}/{id}"?

I have an ASP.NET MVC 5 website. Following the suggestion in various blogs, I used T4MVC to change my routing from: context.MapRoute( name:"MyArea_default", url:"MyArea/{controller}/{action}/{id}", defaults:new { action = "Index", id =…
Gary McGill
  • 26,400
  • 25
  • 118
  • 202
2
votes
1 answer

T4MVC - how to re-generate?

I've installed T4MVC via NuGet. At the point of installation, it generated the helper classes for the project as the project was at that time. However, these generated helper classes have not been updating whenever new items have been added to the…
awj
  • 7,482
  • 10
  • 66
  • 120
2
votes
1 answer

Where can I get this "MVC" class in ASP.NET MVC

I have noticed quite a few posts on web where people use some class named MVC to get controllers and actions. MVC.Home.Index().GetRouteValueDictionary() Where does it come from? I cannot find this class anywhere.
Alex Lapa
  • 1,149
  • 11
  • 21
2
votes
1 answer

Can T4MVC work in VB.NET?

I've read around on this issue but I'm unclear if it's possible to get T4MVC working with VB.NET. I'm using T4MVC and ASP.NET MVC4. I downloaded and installed T4MVCVB from this link and I've already installed the T4MVC package. I've renamed my…
Rowan Freeman
  • 15,724
  • 11
  • 69
  • 100