Asp.net mvc 从视图到控制器的Post有效,但出现错误

Asp.net mvc 从视图到控制器的Post有效,但出现错误,asp.net-mvc,asp.net-mvc-3,Asp.net Mvc,Asp.net Mvc 3,我的视图中有一个表单正在控制器中调用操作 我的看法是: @using(Html.BeginForm("MethodInController","Controller",FormMethod.Post)) { <label for="firstname">Name:</label> <input type="text" name="firstname" /> <br />

我的视图中有一个表单正在控制器中调用操作

我的看法是:

    @using(Html.BeginForm("MethodInController","Controller",FormMethod.Post))
    { 

        <label for="firstname">Name:</label> 
        <input type="text" name="firstname" /> 
        <br />
        <input type="submit" name="submit" />
    }
这个很好用。唯一的问题是,当我点击视图上的submit按钮时,它试图像这样导航到我的控制器:然后我进入azure网站的默认错误页面

我只是想知道是否有一种方法可以在不导航到其他页面的情况下发布数据


谢谢

请看一看,我想这就是正在发生的事情,控制器和视图是项目中的文件夹,以使其更清晰

在一个控制器中,它是这样的:

//when you navigate to this page
public ActionResult Index()
{
    return View();
}

//when you submit on this page
[HttpPost]
public ActionResult Index(string firstname)
{
    string test = (string)ViewData["sbnamespace"];
    return View();
}
和内部索引页:

@using(Html.BeginForm())
{ 

    <label for="firstname">Name:</label> 
    <input type="text" name="firstname" /> 
    <br />
    <input type="submit" name="submit" />
}
@使用(Html.BeginForm())
{ 
姓名:

}
这个问题似乎离题了,因为作者对要解决的问题没有表现出最低限度的理解。你的控制器的名称是什么?你真的有一个名为
ControllerController
的控制器吗?
@using(Html.BeginForm())
{ 

    <label for="firstname">Name:</label> 
    <input type="text" name="firstname" /> 
    <br />
    <input type="submit" name="submit" />
}