This question is locked. New answers and comments are not allowed.
I know this must be a newbie question and there's no lack of DDL examples about, but I can't make this work:
Simple view with a DropDownList and an Upload control:
View Model:
My Save actiion is getting triggered without a problem, but only the file property is populated. I expected the value from the drop down list to be in selectedParser, but it's always null.
What do I need to do to get that value to flow back to the controller?
Thanks.
J
Simple view with a DropDownList and an Upload control:
@model UploadStatementViewModel @{ Layout = "~/Views/Shared/_LayoutTwoColumns.cshtml"; }<div class="paneheader">Upload Statements</div>@using (Html.BeginForm()){ <div>Select the appropriate statement parser:</div> <p> @(Html.Telerik().DropDownList() .Name("selectedParser") .HtmlAttributes(new { style = "width: 300px;" }) .BindTo(PicklistHelper.ParserPicklist()) ) </p> <p> @(Html.Telerik().Upload() .Name("file") .Multiple(false) .Async(async => async .Save("Save", "Statement") .AutoUpload(true)) ) </p>}View Model:
public class UploadStatementViewModel{ public HttpPostedFileBase file { get; set; } public string selectedParser { get; set; }}My Save actiion is getting triggered without a problem, but only the file property is populated. I expected the value from the drop down list to be in selectedParser, but it's always null.
What do I need to do to get that value to flow back to the controller?
Thanks.
J