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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:23:13+00:00 2026-06-04T01:23:13+00:00

Following are controller and view. When [submit] button is being click application raises a

  • 0

Following are controller and view. When [submit] button is being click application raises a error “resource can not found”. I know using Get and Post is very basic concept of MVC. Would any make me the concept clear with some practical scenario when to use Get and Post and WHAT IS WRONG WITH FOLLOWING CODES.

Controller:

namespace MVCModelBinding.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }
        [HttpPost, ActionName("Index")] 
        public ActionResult IndexPost()
        {
            if (Request.Form.Count > 0)
            {

                string id = Request.Form["ID"];

                string fname = Request.Form["FirstName"];

                string lname = Request.Form["LastName"];

                ViewBag.StatusMessage = "Employee data received successfully for ID " + id + "!";

            }

            return View();
        }
        public ActionResult About()
        {
            return View();
        }
    }
}

view (index.chtml)

@using (Html.BeginForm("IndexPost", "HomeController",FormMethod.Post))
{
    <table>
        <tr>
            <td>
                Employee ID
            </td>
            <td>
                @Html.TextBox("ID")
            </td>
        </tr>
        <tr>
            <td>
                First name
            </td>
            <td>
                @Html.TextBox("FirstName")
            </td>
        </tr>
        <tr>
            <td>
                Last Name
            </td>
            <td>
                @Html.TextBox("LastName")
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <input type="submit" value="Submit" />
            </td>
        </tr>
    </table>
}

Thanks

Paul

  • 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-04T01:23:14+00:00Added an answer on June 4, 2026 at 1:23 am

    The action name and controller name used for the form are wrong. It should be

    @using (Html.BeginForm("Index", "Home", FormMethod.Post))
    

    The action name is just "Index" because that’s what you specified with ActionNameAttribute. The controller name should not include the “Controller” suffix.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

info: iOS5, xcode4.3.2, iphone5 Create tab view controller application from xcode template wizard. Following
I have the following View, Controller and Comment.cs code, but I get an error,
I have the following view controller in my UIPopover: @protocol StorePopoverDelegate - (void)storeSelected:(NSString *)store;
here the following code is used to view the present modal view controller. [[self
I have the following model, view and controller. Model public class Person { public
The following code shows 1 view, 1 partial view, and 1 controller . The
If i have a controller action Create that returns a view with the following
I have the following ActionLink in my view <%= Html.ActionLink(LinkText, Action, Controller); %> and
I have the following code in controller: public ActionResult SearchPage() { return View(); }
I have a new MVC 4 Application with a fairly basic View/Controller. The associated

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.