I have a lot of problems in asp.net because I am new to this. so I searched, but I did not find the answer.
Firstly, my aspx viewing engine is not a razor, and this is my main problem.
this is view
<%= 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>
since you have an element that fills the model.
now my question is how to pass this view to the controller (without Ajax) with the submit button.
and this is the controller
public virtual ActionResult Add() { var model = new ResturantSharingViewModel(); model.SharingTargetType = getSharingTargetTypesSelectListItems(); return PartialView(model); }
salar source share