Comments (4)
I added the following extension methods to get it to compile (haven't tested yet though).
public static MvcHtmlString Label(this HtmlHelper html, string expression, string labelText, object htmlAttributes)
{
return LabelHelper(html, ModelMetadata.FromStringExpression(expression, html.ViewData), expression, labelText, htmlAttributes);
}
private static MvcHtmlString LabelHelper(
HtmlHelper html,
ModelMetadata metadata,
string htmlFieldName,
string labelText = null,
object htmlAttributes = null)
{
string str = labelText ?? (metadata.DisplayName ?? (metadata.PropertyName ?? htmlFieldName.Split(
new[]
{
'.'
}).Last()));
if (string.IsNullOrEmpty(str))
{
return MvcHtmlString.Empty;
}
TagBuilder tagBuilder = new TagBuilder("label");
tagBuilder.Attributes.Add(
"for",
TagBuilder.CreateSanitizedId(html.ViewContext.ViewData.TemplateInfo.GetFullHtmlFieldName(htmlFieldName)));
tagBuilder.SetInnerText(str);
RouteValueDictionary attributes = HtmlHelper.AnonymousObjectToHtmlAttributes(htmlAttributes);
tagBuilder.MergeAttributes(attributes);
return tagBuilder.ToMvcHtmlString(TagRenderMode.Normal);
}
from twitter.bootstrap.mvc.
I am not able to reproduce this.. Can you give me some more details of how
you did this.
The steps I followed were:
- open vs2012
- create a new mvc 4 - Empty project
- in nuget console window: install-package twitter.bootstrap.mv4
- in nuget console window: install-package
twitter.bootstrap.mvc4.sample - F5 build and Debug.
from twitter.bootstrap.mvc.
Solved. I did as you suggested and then compared the assembly references. Looks like I had an MVC3 binary being resolved from somewhere. VS had a hint path to a nuget package that no longer existed. The web.config under Views was also pointing to MVC3 and there were MVC3 assemblies being brought in via the root web.config.
I’ve added the MVC4 nuget package, updated the config files and it is all fixed up now.
Thanks
From: Eric Hexter
Sent: 24 November 2012 2:45 AM
To: erichexter/twitter.bootstrap.mvc
CC: Rory Primrose
Subject: Re: [twitter.bootstrap.mvc] Create.cshtml fails build (#12)
I am not able to reproduce this.. Can you give me some more details of how
you did this.
The steps I followed were:
- open vs2012
- create a new mvc 4 - Empty project
- in nuget console window: install-package twitter.bootstrap.mv4
- in nuget console window: install-package
twitter.bootstrap.mvc4.sample - F5 build and Debug.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/12#issuecomment-10663069.
from twitter.bootstrap.mvc.
glad you got it resolved..
from twitter.bootstrap.mvc.
Related Issues (20)
- Error when trying to NUGET install HOT 9
- Bug in NavigationRouteConfigurationExtensions HOT 1
- Model editor does not display Start Date HOT 6
- adding additional attributes to "EditorFor" control HOT 2
- A namespace cannot directly contain members such as fields or methods HOT 7
- Paging issue with active page HOT 6
- End-to-end test: the generated solution does not compile HOT 1
- Support `[Display(Autogenerate=false)]`: decorated properties should not be displayed HOT 1
- htmlAttributes not forwarded
- BeginControlGroupFor doesn't always identify property names from an expression
- Controller alert methods should be extension methods rather than BootstrapBaseController HOT 3
- BootstrapBaseController can't handle multiple alerts HOT 2
- Support for ScaffoldColumn Attribute HOT 2
- Adding Glimpse nuget package breaks navigation extension HOT 6
- Do not use a custom unobrusive validation script HOT 1
- NavigationViewExtensions does not properly add active css class to active nav list item
- Custom text in TwitterBootstrapMVC.Renderers.Renderer.RenderValidationSummary() HOT 1
- Pulls Bootstrap V3 HOT 10
- Update to use twitter.bootstrap 3 HOT 5
- Twitter Bootstrap for ASP.Net MVC 4 Sample 1.1.100 Crash HOT 35
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twitter.bootstrap.mvc.