如果我们有以下代码,
try:
value_abcd = test['a']['b']['c']['d']
except KeyError:
pass
else:
print("value_abcd is", value_abcd)
return # or continue if doing this in a loop
try:
value_abf = test['a']['b']['f']
except KeyError:
pass
else:
print("value_abf is", value_abf)
return
print("do something different")
我们可以使用<input id="Name" name="Name" type="text" data-bind="value: Name" class="title width-7" />
将其翻译为:
@Html.TextBoxFor
现在我有这条线,我不能用'{1}}翻译'placeholder'属性,我怎么能这样做?
@Html.TextBoxFor(m => m.Name, new { data_bind="value: Name", @class = "title width-7" })
感谢...
答案 0 :(得分:1)
是的,要向任何人说清楚:
@Html.TextBoxFor(m => m.Name, new { data_bind="value: Name", @class = "title width-7" , @placeholder ="Placeholder Here"})
感谢。希望它有所帮助。