【发布时间】:2010-10-26 02:05:02
【问题描述】:
好的,这有点令人困惑和沮丧。 这是我的母版页中的内容:
<%using (Html.BeginForm("Index", "SearchController", FormMethod.Post, new { @name = "dosearch" }))
{%>
<input type="text" name="ssearch" class="search"><a href="#" onclick="document.dosearch.submit();"><input id="Image1" type="image" runat="server" src="~/App_Themes/DefaultTheme/images/btn_search.gif" width="74" height="29" style="border:none" /></a>
<%} %>
但是对应生成的html是:
<form action="" method="post" name="dosearch">
<input type="text" name="ticketSearch" class="search"><a href="#" onclick="document.dosearch.submit();"><input src="../App_Themes/DefaultTheme/images/btn_search.gif" name="ctl00$Image1" type="image" id="ctl00_Image1" width="74" height="29" style="border:none" /></a>
</form>
问题是为什么 action 是空的,而我在声明 HTML.Helper 时提到了 action 和 controllername ???? 因此,由于显而易见的原因,seach 无法正常工作。
请帮忙。谢谢。
【问题讨论】:
标签: asp.net-mvc-2 master-pages