1. 程式人生 > >C#_asp.net mvc 驗證碼功能的具體實現

C#_asp.net mvc 驗證碼功能的具體實現

@using (Html.BeginForm("Login", "HomePage",FormMethod.Post))
{
<h2>登入</h2><p class="tyg-p">歡迎訪問 智慧能力</p>
<div style="margin:5px 0px;">
<input id="UserName" name="UserName" type="text" placeholder="請輸入賬號..." />
</div>
<div style="margin:5px 0px;">
<input id="Pwd" name="Pwd" type="password" placeholder="請輸入密碼..." />
</div>
<div style="margin:5px 0px;">
<input id="code" name="code" type="text" style="width:150px;" placeholder="請輸入驗證碼..." />
<img id="CheckCodeImage" src="@Url.Content("~/Common/ValidateCode.ashx")" onclick="this.src='@Url.Content("~/Common/ValidateCode.ashx")?time='+new Date().getTime()" style="cursor:pointer;" title="看不清?換一張" alt="看不清?換一張" />
</div>
<button type="submit">登<span style="width:20px;"></span>錄</button>
}