-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Conversation
<validation-summary tag="div"/> | ||
|
||
@* element will have correct name and id attributes for Id property. but will submit a constant value. *@ | ||
<input type="hidden" for="Id" value="0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file isn't much different from Edit.cshtml but I only use a user-specified HTML attributes (that helper would normally generate) here. suspect "class" attribute would be merged but all other user-specified HTML attributes would just win.
<div class="form-group"> | ||
<label for="DateOfBirth" class="control-label col-md-2" /> | ||
<div class="col-md-10"> | ||
<input type="date" for="DateOfBirth" format="{0:d}" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- at least initially, input tag helper will ignore the "format" bound attribute if "type" is checkbox, hidden, password, or radio.
type="radio"
(not in this sample) needs a value to compare to the expression and the "value" HTML attribute Just Works(tm). so under the covers, that may be the only case where MVC tag helpers useTagHelperContext.AllAttributes
Should showcase |
Would be nice to see a _Layout with a few anchor tag helpers (to show they can be used there). They're perfect for navigation. |
<h2>Create</h2> | ||
|
||
<form> | ||
@Html.AntiForgeryToken() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at one point we discussed adding this as a parameter to <form>
, something like:
<form addAntiForgeryToken="true">
I could just be misremembering though. /cc @DamianEdwards
🐃 |
<input type="hidden" for="Id" value="0" /> | ||
|
||
<div class="form-group"> | ||
<label for="Name" class="control-label col-md-2" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since <label/>
already has a "for" attribute, we should probably use another name for the <label/>
/ <input/>
/ <select/>
/ <textarea/>
expression bound attribute. @DamianEdwards any suggestions?
👌
👎 already using
what does the water buffalo mean? |
Buffalo is my version of ⌚ , trying to be a trend setter . I was thinking a |
8b68658
to
ce49b77
Compare
58c3268
to
9f0d7ad
Compare
Rebased and updated @yishaigalatzer @Eilon @DamianEdwards please let @NTaylorMullen and I know if the sample and its comments misses anything from our meeting. |
<label for="YearsEmployeed" class="control-label col-md-2" /> | ||
<div class="col-md-10"> | ||
@* <select/> tag helper has ContentBehavior.Append -- items render after static options *@ | ||
<select for="YearsEmployeed" items="(IEnumerable<SelectListItem>)ViewBag.Items" size="2" class="form-control"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"items" attribute needn't be so ugly. I just didn't switch from User
to UserViewModel
in this sample.
d948242
to
b68fae9
Compare
9f0d7ad
to
753c3ca
Compare
…scussion - lots of new comments in Create.cshtml
753c3ca
to
82cce78
Compare
Add Tag Helper sample, #1242