Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormBlocks #20

Open
TDK1964 opened this issue Jun 1, 2016 · 1 comment
Open

FormBlocks #20

TDK1964 opened this issue Jun 1, 2016 · 1 comment

Comments

@TDK1964
Copy link

TDK1964 commented Jun 1, 2016

Hi Jimmy, I've been reading you articles about templates and like the way you did the FormBlock code. However, I can't seem to get a textarea to display. I've added [DataType(DataType.MultilineText)] to my model property but it seems to ignore it. Should I extend your example and create a specific "TextAreaBlock" or something else?

@StrykerNinja
Copy link

TDK1964,

I am not sure if this is the "correct" way to do it, but I added the following code to the DefaultAspNetMvcHtmlConventions.cs file:

Editors.If(er =>
{
var attr = er.Accessor.GetAttribute<DataTypeAttribute>();
return attr != null && attr.DataType == DataType.MultilineText;
}).ModifyWith(m => m.CurrentTag.TagName("textarea").Attr("rows", "3"));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants