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 6217993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:31:22+00:00 2026-05-24T07:31:22+00:00

I am getting an error saying the view Update has not been found, I

  • 0

I am getting an error saying the view Update has not been found, I wanted to show the TaskDetail view not the update view…

    [HttpPost]
    [ValidateAntiForgeryToken]
    public ActionResult Update(int taskid, string status)
    {
        if (!status.Equals("closed", StringComparison.OrdinalIgnoreCase) &&
            !status.Equals("opened", StringComparison.OrdinalIgnoreCase))
            ModelState.AddModelError("", "incorrect status, please try again");

        if (!this.ModelState.IsValid)
            return TaskDetail(taskid);

        if (status.Equals("Closed", StringComparison.OrdinalIgnoreCase))
            _service.CloseTask( taskid, true);
        else
            _service.CloseTask(taskid, false);

        this.FlashInfo("success, task status has been updated...");
        return RedirectToAction("TaskDetail");

}

Exception:

$exception{"The view 'Update' or its master was not found. The following locations were searched:\r\n~/Areas/Tasks/Views/TaskManager/Update.aspx\r\n~/Areas/Tasks/Views/TaskManager/Update.ascx\r\n~/Areas/Tasks/Views/Shared/Update.aspx\r\n~/Areas/Tasks/Views/Shared/Update.ascx\r\n~/Views/TaskManager/Update.aspx\r\n~/Views/TaskManager/Update.ascx\r\n~/Views/Shared/Update.aspx\r\n~/Views/Shared/Update.ascx"} System.Exception {System.InvalidOperationException}

Task Detail: (this is inside the same controller)

    [HttpGet]
    public ActionResult TaskDetail(int taskid)
    {
        var loggedonuser = _repo.GetCurrentUser();


        var companies = _repo.All<Company>();
        var users = _repo.All<User>();

        var task = _repo.Single<InstructionTask>
            (x => x.TaskID == taskid && (x.CompanyID == loggedonuser.CompanyID || x.AssignedTo.Contains(loggedonuser.CompanyType.ToString())));

        var dto = new TaskDTO
        {
            TaskID = task.TaskID,
            Title = task.Title,
            Description = task.Description,
            DateCreated = task.DateCreated,
            IsClosed = task.IsClosed,
            CompanyID = companies.Where(y => task.CompanyID == y.CompanyID).SingleOrDefault().Identifier,
        };

        var checkedtags = TaskTagsHelper.GetTags(task.AssignedTo);

        var t = TaskTagsHelper.GetPanelTags();

        if (checkedtags != null) //if tags are present only then tick them off...
        {
            foreach (var item in t.Keys.ToList())
            {
                if (checkedtags.Any(x => x == item))
                    t[item] = true;
            }
        }

        dto.AvailableTags = t;

        if (task.DueDate.HasValue)
            dto.DueDate = task.DueDate.Value;

        var comments = _repo.All<TaskComment>()
            .Where(x => x.TaskID == task.TaskID)
            .OrderByDescending(x => x.Timestamp)
            .Select(x => new TaskCommentDTO
            {
                Comment = x.Comment,
                Timestamp = x.Timestamp,
                CompanyID = companies.Where(y => x.CompanyID == y.CompanyID).SingleOrDefault().Identifier,
                UserID = users.Where(y => x.UserID == y.UserID).SingleOrDefault().Login,
                Type = EnumHelper.Convert<TaskCommentType>(x.Type)
            });

        dto.AllComments = comments;

        return View(new TaskViewModel
        {
            TaskDetail = dto,
            NewComment = new TaskCommentDTO()
        });
    }

I am catching the exception here in my base controller:

    //Generic methods/ controllers/ attributes will be applied here...
    protected override void OnException(ExceptionContext filterContext)
    {
        //dont interfere if the exception is already handled
        if (filterContext.ExceptionHandled)
            return;

        //let the next request know what went wrong
        filterContext.Controller.TempData["exception"] = filterContext.Exception;

        //logg exception

        //set up redirect to my global error handler
        filterContext.Result = new ViewResult { ViewName = "~/Views/Error/PublicError.aspx" };

        //advise subsequent exception filters not to interfere and stop
        // asp.net from showing yellow screen of death
        filterContext.ExceptionHandled = true;

        //erase any output already generated
        filterContext.HttpContext.Response.Clear();
    }
  • 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-05-24T07:31:23+00:00Added an answer on May 24, 2026 at 7:31 am

    From what I understand of your code, you are calling the TaskDetail action from the Update method. This is not recommended. Here is why:

    1. The owning context of the request is the Update method, which is why it’s trying to render the “Update” view. That is because by convention the view is selected based on the first action that is hit. MVC is unaware that you’ve called TaskDetail.
    2. It’s a violation of the PRG pattern (Post-Redirect-Get). I suggest you read up on this here: http://en.wikipedia.org/wiki/Post/Redirect/Get – Basically, you really shouldn’t render anything out from an HTTP POST. You should redirect back to a GET. It causes all sorts of problems not doing this.

    If you want it working as it is, you can do this by changing the last line of the TaskDetail to the following so that it knows to always render the TaskDetail view, but I do not recommend it:

    return View("TaskDetail", ...viewModel...)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We're getting a server error saying Parameter count does not match Parameter Value count.
I'm getting an error in my Android app that says source not found and
I am getting a compile error, saying that the copy constructor of the scoped_ptr
I'm getting an error saying, Limit exceeded when I am submitting my sitemap to
I'm getting a e.PropertyChanged error saying there's no exstension method and no definition. I'm
i am having code which is using javax.comm lib file,i am getting error saying
I am getting this error when running a webpage in internet explorer 8 (not
I am getting an error in my logcat saying Your content must have a
I am getting an error saying: The model item passed into the dictionary is
getting error while try to start service

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.