Question

I've built an ASP MVC site and used bootstrap, Jquery, knockout and signalR, and inherited a mix of 3rd party MVC code integrated with controls like syncfusion. (I don't have a choice in this matter, company decision)

After coding the HTML helpers in the views,

I manually applied all the bootstrap styles took sometime and got it to work. Now, with upgrade/changes to bootstrap (RC 3.1) I am finding myself back to square one, hunting through the code and replacing it manually, lots of changes. Can you please share a better way to transpile/emit/bind the bootstrap CSS classes into the helpers (i.e. in an independent way of the technology helper, whether its ASP HTML MVC helper, Syncfusion HTML MVC helper, Rad or FluentBootStrap)

Please provide a solution/recommendation to apply bootstrap CSS to ASP MVC pages

  • That's easy to separate and maintain and CSS upgrade's Programmtically
  • or globally configurable/settable/applicable
  • I've been thinking extension classes might be a good option, but not sure how I can achieve this, if you've can show me how to get the custom bootstrap CSS bound so I can programatically apply it or globally,
  • Is there a transpiler or Razor Declaritve Helper (I know about the nuget package, I tried applying it, and it turned out to be more of a template, than declarative extension binding, and I couldnt use it with other libraries Syncfusion or DevExpress)

  • or some other way, I would greatly appreciate it.

Here is an example of what I do currently, with the Syncfusion library

@Html.Syncfusion().Menu("myMenu").AutoFormat((Skins)ViewData["Themes"]) - performance hog       

or better option 2 below

http://mvc.syncfusion.com/demos/ui/tools/Menu/Appearance

@(Html.Syncfusion().Button("btnNormal")
                        .Text("Save")
                        .Width(100)
                        .Height(50)
                        .ContentType(ContentTypes.TextAndImage)
                        .ImageUrl(Url.Content("~/Content/Images/Button/icon_save.png"))
                        .CustomCSS("CustomCss_Button") )  

-> I changed/upgraded manually to BootStrap RC 3.1, I changed this last part to the bootstrap

.CustomCSS("btn-default dropdown-toggle btn-primary"))  
Was it helpful?

Solution

Not sure this would be helpful to you, but check out TwitterBootstrapMVC. Right now it supports v2.* of TwitterBootstrap, but the support for v3.* is being built.

OTHER TIPS

Our answer is from the experience we are going through. Here is what we found,

currently, The twitter bootstrap MVC is your best option IMHO, we are moving everything to it and its free! Its probably better the broiler plate option.

  1. The 3.0 upgrade is a big question for us as well, so this is something Dmitry can clarify.
  2. Also, auto creating type safe bootstrap HTML views/sections for models is another question.
  3. In addition you will face challenges with custom controls, we have a OLAP BI client, which looks / or doesn't not have the same consistent look. Dmitry can you answer how to resolve this with twitterbootmvc
  4. Dmitry, will the twitterbootstrap upgrade, auto upgrade to the 3.0 bootstrap or do we have do anything manually?

I just discovered that in visual studio you can for the precompile of RAZOR into HTML.

Can you add that as an option to fluent

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top