Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7864763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:53:00+00:00 2026-06-02T23:53:00+00:00

I am trying to learn ASP.net MVC 2 and I have created the DB

  • 0

I am trying to learn ASP.net MVC 2 and I have created the DB table, Model, View and Controller for a sample Bug Tracking System with just one table. I am also able to perform CRUD operations on the bug tracker. When I create a ‘New Bug’ the application asks me for Bug Name, Bug Id, Bug Description, Bug create date, Bug Due date.
My question is I don’t want to enter the Bug create date and Bug Due date every time. I want the Bug Create Date to be auto populated with the current date and time from the system. And the bug Due date to be auto populated with the value that is & days from the create date that is current date+ 7 days.
Should I do this in views? Do I need to do this using JavaScript or is there any other way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T23:53:01+00:00Added an answer on June 2, 2026 at 11:53 pm

    Assuming you have a strongly typed view, currently for create view you must be sending a new instance of the model from the controller.

    public ActionResult Create()
    {
        DBModel model = new DBModel();
        return View(model);
    }
    

    If you set the date properties and send the model as shown below, your date fields should be populated in the view.

    public ActionResult Create()
    {
        DBModel model = new DBModel();
        model.BugCreateDate = DateTime.Now;
        model.BugDueDate = DateTime.Now.AddDays(7);
        return View(model);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to learn ASP.NET MVC and I hit this problem: I have
I'm trying to learn ASP.NET MVC, and I want to have menus highlighted on
I was trying to download some ASP.NET MVC Sample application to learn MVC. I
I am trying to learn asp.net MVC and having an issue to submit a
I'm trying to learn ASP.NET MVC + Entity Framework by developing a small project.
I am trying to learn some ASP.NET MVC. Please bear with me but asp.net
I am trying to decide whether to learn ASP.NET MVC (or to spend the
I am finally experimenting and trying to learn MVC after years of asp.net. I
I am trying to learn new stuff about jquery, html, asp .net mvc. I
I am trying to learn ASP.NET (since I know C#) so I have decided

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.