ASP.net form submission returning null value for model parameters when submitting

I am building a c# assignment and facing an issue. I have 2 models students and course. I needed a place to show all the student related to a course and ability to add new student. so i created a new View model CourseViewModel

using ProblemAssignment2.Models;

namespace ProblemAssignment2.ViewModels
{
    public class CourseViewModel
    {
        public Course Course { get; set; }
        public Student NewStudent { get; set; }
    }
}

I have a Manage.cshtml page in views/Course folder.

@model ProblemAssignment2.ViewModels.CourseViewModel

<h1>Manage Course</h1>

<div>
    <h4>@Model.Course.Title</h4>
    <table class="table">
        <thead>
            <tr>
                <th>Last Name</th>
                <th>First Name</th>
                <th>Email</th>
                <th>Status</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var student in Model.Course.Students)
            {
                <tr>
                    <td>@student.LastName</td>
                    <td>@student.FirstName</td>
                    <td>@student.Email</td>
                    <td>@student.EnrollmentStatus</td>
                </tr>
            }
        </tbody>
    </table>
</div>

<h2>Create Student</h2>
<form asp-action="createStudent" method="post">
    <div class="form-group">
        <label asp-for="NewStudent.LastName" class="control-label">Last Name</label>
        <input asp-for="NewStudent.LastName" name="Last" class="form-control" />
        <span asp-validation-for="NewStudent.LastName" class="text-danger"></span>
    </div>
    <div class="form-group">
        <label asp-for="NewStudent.FirstName" class="control-label">First Name</label>
        <input asp-for="NewStudent.FirstName" name="First" class="form-control" />
        <span asp-validation-for="NewStudent.FirstName" class="text-danger"></span>
    </div>
    <div class="form-group">
        <label asp-for="NewStudent.Email" class="control-label">Email</label>
        <input asp-for="NewStudent.Email" name="Email" class="form-control" />
        <span asp-validation-for="NewStudent.Email" class="text-danger"></span>
    </div>
    <button type="submit" class="btn btn-primary">Create Student</button>
</form>

<h2>Send Confirmation Message</h2>
<form asp-action="SendConfirmationMessage" method="post">
    <input type="hidden" name="courseId" asp-for="@Model.Course.CourseID" />
    <button type="submit" class="btn btn-secondary">Send Confirmation Message</button>
</form>

@section Scripts {
    @{await Html.RenderPartialAsync("_ValidationScriptsPartial");}
}

in CourseController.cs i ahve added 2 methods to show view and createstudent

public async Task<IActionResult> Manage(int? id)
        {
            if (id == null)
            {
                return NotFound();
            }

            var course = await _context.Courses
                .Include(c => c.Students)
                .FirstOrDefaultAsync(m => m.CourseID == id);

            if (course == null)
            {
                return NotFound();
            }

            var viewModel = new CourseViewModel
            {
                Course = course,
                NewStudent = new Student()
            };

            return View(viewModel);

        }

        [HttpPost]
        [ValidateAntiForgeryToken]
        public async Task<IActionResult> createStudent(int id, CourseViewModel viewModel)
        {
            Debug.WriteLine(viewModel.Course.CourseID);
            viewModel.NewStudent.EnrollmentStatus = Student.Status.InvitationSent;
            if (ModelState.IsValid)
            {
                var course = await _context.Courses.FindAsync(id);
                if (course == null)
                {
                    return NotFound();
                }

                viewModel.NewStudent.CourseID = id;
                viewModel.NewStudent.EnrollmentStatus = Student.Status.InvitationSent; // Default status
                _context.Students.Add(viewModel.NewStudent);
                await _context.SaveChangesAsync();

                return RedirectToAction(nameof(Manage), new { id = viewModel.Course.CourseID });
            }

            // If ModelState is invalid, return the Manage view with the current viewModel
            

            return View(nameof(Manage), id);
        }

i am able to view all the students related to course. but when i add some data to form and try to submite it i am getting null exceptions.

I added breakpoints on createstudent and found out that id value is 0 and viewModel.Course and viewModel.NewStudent both are null. what can be reason that on submit of form both these values are getting set as null.

I have checked in manage function i am setting course value and also initializing newStudent to a object.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật