0
我的MVC應用程序出現問題。 我有一個登錄視圖MVC ActionLink問題
<% Html.EnableClientValidation(); %>
<% using (Html.BeginForm())
{%>
<%: Html.ValidationSummary(true)%>
<fieldset>
<legend>Login</legend>
<div class="editor-label">
<%: Html.LabelFor(model => model.Username)%>
</div>
<div class="editor-field">
<%: Html.TextBoxFor(model => model.Username)%>
<%: Html.ValidationMessageFor(model => model.Username)%>
</div>
<div class="editor-label">
<%: Html.LabelFor(model => model.Password)%>
</div>
<div class="editor-field">
<%: Html.PasswordFor(model => model.Password)%>
<%: Html.ValidationMessageFor(model => model.Password)%>
</div>
<p>
<input type="submit" value="Login" />
</p>
</fieldset>
<%: Html.ActionLink("Set Email",
"SetEmail",
"GASLogin",
new {model = Model.Username},
null)%>
<% } %>
和一個ActionLink。當我單擊動作鏈接時,我會發送一封電子郵件到文本框「<%:Html.TextBoxFor(model => model.Username)%>」的郵件地址。 問題是我的Model.Username爲空。 那麼我該如何做到這一點?
謝謝。