关于MVC的专业人士的重要问题 [英] Important question to professionals about MVC
本文介绍了关于MVC的专业人士的重要问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,全部,
我是MVC的新手,但在与ASP.NET的比较中对我来说看起来很奇怪。
也许我的问题是愚蠢的,不包含任何意义但是:
以下是标准MVC示例的标记示例(我想大家都知道)。
Hello, All,
I am new in MVC but it look strange for me in comparisone with ASP.NET.
Maybe my question is stupid and does not contain any sence but:
Here is an example of markup from standard MVC example (I think all of you know it).
<% foreach (var item in Model) { %>
<tr>
<td>
<%= Html.ActionLink("Edit", "Edit", new { id=item.DinnerId }) %> |
<%= Html.ActionLink("Details", "Details", new { id=item.DinnerId })%>
</td>
<td>
<%= Html.Encode(item.DinnerId) %>
</td>
<td>
<%= Html.Encode(item.Title) %>
</td>
<td>
<%= Html.Encode(String.Format("{0:g}", item.EventDate)) %>
</td>
<td>
<%= Html.Encode(item.Description) %>
</td>
<td>
<%= Html.Encode(item.HostedBy) %>
</td>
</tr>
<% } %>
为什么< asp:Repeater />在这里没有使用?
Why <asp:Repeater /> was not used here?
在MVC中显示数据是一种正确而好的方式吗?
Is it a proper and good way to show data in MVC?
如果有,请描述我原因。
If so, please describe me why.
提前谢谢。
推荐答案
因为转发器是服务器控件和MVC不使用它们。
Because a repeater is a server control and MVC doesn't use them.
这篇关于关于MVC的专业人士的重要问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文