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

ASP.NET Route not being hit with correct mapping

Why is: @Url.Action("Divisions", "Widgets", new {version = 1, eventId = Model.Event.Id, slug = Model.Event.Slug}) Generating this: http://localhost:2227/widgets/divisions?version=1&eventid=36295&slug=notifications When my route is like this. …
Mike Flynn
  • 22,342
  • 54
  • 182
  • 341
0
votes
1 answer

Problem setting up T4MVC and MVC 2

I'm setting up T4MVC for MVC 2 on my website. I get 2 build errors: No overload for method 'RenderAction' takes 3 arguments in T4MVC.cs and No overload for method 'Action' takes 3 arguments in T4MVC.cs These are the ones in the T4MVC.cs file: public…
knepe
  • 325
  • 1
  • 3
  • 9
0
votes
1 answer

T4MVC JavaScriptReplacableUrl not working

I'm trying to use JavaScriptReplacableUrl to get a url on client side and replace parameters. My controller method: virtual ActionResult Details(int id = 0, int acctJobID = 0) javascript to test…
DLeh
  • 23,806
  • 16
  • 84
  • 128
0
votes
2 answers

problem with routing/T4MVC Url.Action()

I have these 2 routes : routes.MapRoute("Agenda", ConfigurationManager.AppSettings["eventsUrl"] + "/{year}/{month}", MVC.Events.Index(), new { year = DateTime.Now.Year, month = DateTime.Now.Month }); routes.MapRoute("AgendaDetail",…
VinnyG
  • 6,883
  • 7
  • 58
  • 76
0
votes
1 answer

Integrating mvc.jquery.datatables and T4MVC

I'm using mvc.jquery.datatables with Asp.Net MVC 4 and DataTables It works fine and as expected. When I introduce T4 MVC to replace MVC magic strings, T4 MVC does not like the return type that mvc.jquery.datatables wants me to use in my Ajax action…
ozz
  • 5,098
  • 1
  • 50
  • 73
0
votes
1 answer

T4MVC and parameter with list not creating correct url

Is there a way to generate a url with T4MVC with a parameter of list? Right now it gives me this. public virtual ActionResult Scoresheets(int? eventId, int? gameId, List gameIds) …
Mike Flynn
  • 22,342
  • 54
  • 182
  • 341
0
votes
3 answers

T4MVC MapRoute doesn't work?

I am trying to setup index page route. It works this way: routes.MapRoute("", "", new {controller = "Home", action = "Index"}) but if I replace it with T4MVC: routes.MapRoute("", "", MVC.Home.Index()); somehow it doesn't work (I get a "The…
SiberianGuy
  • 24,674
  • 56
  • 152
  • 266
0
votes
0 answers

Why I can not return a View assigned to another action method in another controller in MVC

I have a controller that has a metod that returns a View that accepts an object of type "A". [HttpGet] public virtual ActionResult FirstMethod(){ //logics return View(MVC.MyController.Views.MyView, objectOfTypeA) } Form another action in another…
mathinvalidnik
  • 1,566
  • 10
  • 35
  • 57
0
votes
0 answers

T4MVC can't handle two controllers of the same name

I'm trying to use T4MVC but it doesn't seem to work in my situation of having two controllers of the same name in different namespaces. I've got the following two controllers: MyNamespace.Api.HomeController (an…
Joshua Frank
  • 13,120
  • 11
  • 46
  • 95
0
votes
1 answer

T4MVCVB doesn't work on clean install?

I just installed T4MVCVB and it won't compile: Error 1 Compiling transformation: Invalid token 'this' in class, struct, or interface member declaration c:\...\T4MVCVB.tt 1 1 Error 2 Compiling transformation: Method must have a return…
Joshua Frank
  • 13,120
  • 11
  • 46
  • 95
0
votes
1 answer

MVC5 Attribute Route, emitting null for route without optional params

I have on the controller: [RoutePrefix("")] The action with route: [Route("things-to-do/{filter1?}/{filter2?}/{filter3?}/{filter4?}/{Area?}", Name = "thingstodo")] public async virtual Task ThingsToDo(string filter1 = "",…
0
votes
1 answer

T4MVC in ASP.NET MVC4 vs2013

I have legacy mvc3 project wich was migrated from mvc2. There is T4MVC in use. First of all i would like to mention that guys who migrated to MVC3 left ProjectTypeGuids for MVC2. I migrated to mvc4 by following…
Brivvirs
  • 2,461
  • 3
  • 18
  • 31
0
votes
1 answer

T4MVCJs with MVC 5 and .NET 4.5.1

Is there a way to configure T4MVCJs to work with MVC 5 (.Net 4.5.1) ? I installed the latest version (on Nuget) which claims to use T4MVC Version 2.6.57. In the end, I just want to use this or something like it via a T4 Template that will generate…
piercove
  • 811
  • 9
  • 17
0
votes
1 answer

How can I use T4MVC with the external login confirmation form in the default MVC5 project?

In the default ASP.NET MVC 5 web project, the "Login" view ("Login.cshtml") has a BeginForm call like this: @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role =…
Gary McGill
  • 26,400
  • 25
  • 118
  • 202
0
votes
1 answer

"anonymous type" parameter in T4MVC Actionresult

I am trying to figure out if I can do this, and how.. I have an action result defined this way : public virtual JsonResult Created(string tableName, object where) { ....some code } I am using T4MVC and I am trying to call the action…
Oana Marina
  • 277
  • 3
  • 19