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
1
vote
1 answer

T4MVC renderpartial and Spark views

#Html.RenderPartial(MVC.Shared.Views._Sorter); throws error => There is no build provider registered for the extension '.spark'. You can register one in the section in machine.config or web.config. Make sure is has a…
Arnis Lapsa
  • 45,880
  • 29
  • 115
  • 195
1
vote
0 answers

T4MVC run custom tool not generate actions

I trying all possibilities: uninstall T4MVC, install another version, changing prefix, delete last line from .tt file http://hadsy.net/2011/05/17/CompilingTransformationInvalidTokenThisInClassStructOrInterfaceMemberDeclaration.aspx , also I have…
1
vote
1 answer

T4MVC: Strongly typed partial?

I'm using T4MVC in my MVC 5 website. In a view, I have something like: @Html.Partial(MVC.Shared.Views.ViewNames.Foo, Model.FooBar) The Foo view expects a certain type, which is defined with @model, but Model.FooBar might have a different type. This…
DanielR
  • 684
  • 2
  • 9
  • 20
1
vote
1 answer

How can I generate links to other MVC applications?

I've created three related ASP.NET MVC web-applications that sit in IIS like so: root |-Emailing |-InternalManagement Where the root site is customer facing. The three sites have different security requirements and I wanted to be able to modify…
Chris Nevill
  • 5,922
  • 11
  • 44
  • 79
1
vote
1 answer

Why is homepage of area not being hit?

The director below keeps redirecting to my homepage (Home/Index). I'm not sure why, but I have other areas created called Coaches and Directors, and they work fine. Fiddler only shows a 302 from that dashboard action to the homepage. If I go to…
Mike Flynn
  • 22,342
  • 54
  • 182
  • 341
1
vote
2 answers

Does T4MVC work with Visual Studio 2010 Beta 2 and .Net 4?

I cannot get the current build of T4MVC (2.6.02) to work with an ASP.NET MVC 2 project compiled against .NET 4 in VS2010 Beta 2. There is one error: The C# 2.0 and C# 3.5 compilers are no longer supported. Templates will always be compiled with the…
Jedidja
  • 16,610
  • 17
  • 73
  • 112
1
vote
1 answer

Why do my T4MVC generated links have "Area=" when I do not use or define areas?

Using ASP.NET MVC 4 and T4MVCExtension 4.0, I generate a link with @Url.Action(T4Controllers.EnhancementList.ByVotes()) and get http://localhost:1025/Enhancements/EnhancementList?Area=. Any ideas on how to get rid of that extra-ugly url…
flipdoubt
  • 13,897
  • 15
  • 64
  • 96
1
vote
1 answer

How to implement "Change Password" redirection in .Net MVC4?

In .Net MVC4 I'm using a subclassed AuthorizeAttribute to redirect all requests to the "Change Password" page when a user's password has been reset as follows: public override void OnAuthorization(AuthorizationContext filterContext) { …
Steve Chambers
  • 37,270
  • 24
  • 156
  • 208
1
vote
4 answers

Cannot inherit a Base Controller class which has no default constructor

I have a BaseController which inherited by another controllers, BaseController: public partial class BaseController : Controller { private readonly IUnitOfWork _uow; private readonly INewsService _newsService; protected…
user197508
  • 1,282
  • 2
  • 18
  • 31
1
vote
1 answer

T4MVC is generating namespace for controllers incorrectly

I've just plugged T4MVC (3.5.1) into my ASP.NET MVC3 project. It seems to be generating the wrong namespace in the *.generated.cs files. For example: using System.Web; using System.Web.Hosting; using System.Web.Mvc; using System.Web.Mvc.Ajax; using…
elwyn
  • 10,360
  • 11
  • 42
  • 52
1
vote
2 answers

T4MVC increasing compile time drastically in ASP.Net MVC

I am using T4MVC to generate templated files for MVC and I have noticed that it is increasing my build time drastically. If I take a look at the Output window, it firsts builds the referenced projects quite fast (around 5 seconds) and then when it…
Mark Cassar
  • 1,842
  • 4
  • 20
  • 27
1
vote
2 answers

ActionLink using T4MVC with a block a HTML code

Is there a way to get this working: @foreach (var item in Model.CategoryListByKeywordsDetails) {
  • @Html.ActionLink("ver >", MVC.Ad.ListByCategory(item.Id, (string)ViewBag.keywords)) { …
  • Patrick
    • 2,995
    • 14
    • 64
    • 125
    1
    vote
    1 answer

    ASP.NET Route Not Hitting Default with T4MVC

    This wasnt happening before but all of a sudden I am not hitting my default route anymore. My homepage goes to http://localhost:2222/assets/images/30?Controller=home&Action=index. Why would this be happening? I noticed when I am in a action on the…
    Mike Flynn
    • 22,342
    • 54
    • 182
    • 341
    1
    vote
    0 answers

    T4MVC hidden model classes from view dialog

    I've noticed recently that when adding views to controller methods, the dialog doesn't list any of my model classes. I can still generate views and specify the model to be used but it is no longer available in the dialogue options.(currently got…
    Tim
    • 7,401
    • 13
    • 61
    • 102
    1
    vote
    1 answer

    T4MVC Html.BeginForm with multiple input submits

    The controller ... [HttpPost] public virtual ActionResult PickAColour(ColourModel model, string imgbtn, string returnUrl) { and the view ... @using…
    Tom
    • 15,781
    • 14
    • 69
    • 111