【发布时间】:2015-02-04 05:11:07
【问题描述】:
我在 asp.net 中有很多问题,因为我是新手。所以我搜索了但我没有找到我的答案。
首先我的视图引擎是 aspx 不是剃须刀,这是我的主要问题。
这是视图
<%= Html.HiddenFor(model => model.SharingPremiumHistoryID) %>
<%= Html.HiddenFor(model => model.ItemId) %>
<div class="group">
<span> ارسال به </span>
<%= Html.DropDownListFor(model => model.SharingTargetType, Model.SharingTypes) %>
</div>
</hgroup>
<div class="newseditor">
<div class="input-form">
<%= Html.LabelFor(model => model.SharingTitle, "عنوان خبر") %>
<%= Html.TextBoxFor(model => model.SharingTitle) %>
</div>
<div class="input-form">
<%= Html.LabelFor(model => model.Content, "متن خبر") %>
<%= Html.TextAreaFor(model => model.Content) %>
</div>
<div><input id="fileUpload" type="file" />
</div>
<button name="post" type="submit" >ارسال خبر</button>
就像你一样,我有一些可以填充模型的项目。
现在我的问题是我如何通过提交按钮将此视图传递给控制器(没有 Ajax)。
这是控制器
public virtual ActionResult Add()
{
var model = new ResturantSharingViewModel();
model.SharingTargetType = getSharingTargetTypesSelectListItems();
return PartialView(model);
}
【问题讨论】:
标签: c# asp.net-mvc