मैं MVC करने के लिए नया हूँ और मैं अपने अनुप्रयोग के लिए एक पंजीकरण प्रपत्र बना रहा हूं, लेकिन मेरे बटन क्लिक वर्तमान कोड काम नहीं कर रहा नीचेकैसे MVC में बटन क्लिक गति प्रदान करने के 4
दृश्य नहीं दिया जाता है
<fieldset>
<legend>Sign Up</legend>
<table>
<tr>
<td>
@Html.Label("User Name")
</td>
<td>
@Html.TextBoxFor(account => account.Username)
</td>
</tr>
<tr>
<td>
@Html.Label("Email")
</td>
<td>
@Html.TextBoxFor(account => account.Email)
</td>
</tr>
<tr>
<td>
@Html.Label("Password")
</td>
<td>
@Html.TextBoxFor(account => account.Password)
</td>
</tr>
<tr>
<td>
@Html.Label("Confirm Password")
</td>
<td>
@Html.Password("txtPassword")
</td>
</tr>
<tr>
<td>
<input type="submit" name="btnSubmit" value="Sign Up" />
</td>
</tr>
</table>
</fieldset>
मॉडल
public class Account
{
public string Username { get; set; }
public string Email { get; set; }
public string Password { get; set; }
}
नियंत्रक (पूरी तरह से पूरा नहीं)
public class AccountController : Controller
{
//
// GET: /Account/
public ActionResult Index()
{
return View();
}
// GET: /Account/SignUp
public ActionResult SignUp()
{
return View();
}
[HttpPost]
public ActionResult SignUp(string userName,string email,string password)
{
Account createAccount = new Account();
createAccount.Username = userName;
createAccount.Email = email;
createAccount.Password = password;
return View("Index");
}
}
यहां क्लिक ईवेंट को परिभाषित करने के लिए कैसे मैंने http पोस्ट की कोशिश की लेकिन यह काम नहीं कर रहा है मुझे पता है कि मेरा कोड सही नहीं है कृपया ध्यान दें कि
आप अपना दृश्य चारों ओर एक रूप की क्या ज़रूरत है के रूप में मैं नहीं कर सकते एक –
देखना ** [क्लाइंट साइड पर इसे करने के लिए यहां देखें] (http://stackoverflow.com/a/16245682/2007801) ** –