So basically once the user clicks on the module for create, I would want it to show the module shown instead of a drop down list for selection.
@model Module1.Models.Learn
@{
ViewBag.Title = "Create";
}
<h2>Create</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"type="text/javascript"></script>
@using (Html.BeginForm()) {
@Html.ValidationSummary(true)
<fieldset>
<legend>Learn</legend>
<div class="editor-label">
@Html.LabelFor(model => model.ModuleId, "Module")
</div>
<div class="editor-field">
@Html.DropDownList("ModuleId", String.Empty)
@Html.ValidationMessageFor(model => model.ModuleId)
</div>
Above is my Create View for Learning Outcome.
@model Module1.Models.Module
@{
ViewBag.Title = "Details";
}
<h2>Learning Outcome : @Model.Code</h2>
<br /
This is the Details View for my Learning Outcome. I tried using the code "@Module.Code" to portray in my Create View but was unsuccessful. Is there another way for me to have the same result in the create view?
My Module Model
using System.Collections.Generic;
namespace Module1.Models
{
public class Module
{
public int ModuleId { get; set; }
public int CourseId { get; set; }
public int LecturerId { get; set; }
public string Code { get; set; }
public string Description { get; set; }
public virtual Course Course { get; set; }
public virtual Lecturer Lecturer { get; set; }
public List<Reference> References { get; set; }
public List<Assessment> Assessments { get; set; }//new
public List<Front> Fronts { get; set; }
public List<Learn> Learns { get; set; }
public List<Topic> Topics { get; set; }
}
}
My Learn Model
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Module1.Models
{
public class Learn
{
public int LearnId { get; set; }
public int ModuleId { get; set; }
public string LearnText { get; set; }
public bool A { get; set; }
public bool B { get; set; }
public bool C { get; set; }
public bool D { get; set; }
public bool E { get; set; }
public bool F { get; set; }
public bool G { get; set; }
public bool H { get; set; }
public bool I { get; set; }
public virtual Module Module { get; set; }
}
}