Hi,
i have view with few butons. when i click button am displaying a view in pop up using kendo window.
here i have a form with 2 fields. after entering form data and submit ,in controller action i want to check whether those 2 fileds values are exists.
if exists i want to show error message with values are already exists, i not exists in database then i want to insert those values.
below is my code
@(Html.Kendo().Window()
.Name("AddProjectWindow")
.Modal(true)
.Width(750)
.Height(500)
.Draggable()
.Resizable()
.Title("Add New Project")
.Actions(actions => actions.Close())
.LoadContentFrom("AddProject", "Home")
.Visible(false)
)
this is my partial popup view
@model Enhancements.Models.Project
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
</head>
<body>
<div>
@{
using (Html.BeginForm("SubmitAddNewProject", "Home", FormMethod.Post, new { id = "basicUsage" }))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<table>
<tr>
<td>Enter Project Code <label style="color:red">*</label></td>
<td> @Html.TextBoxFor(x => x.ProjCode)</td>
<td>
@Html.ValidationMessageFor(m => m.ProjCode, "", new { @class = "text-danger" })
</td>
</tr>
<tr>
<td>Enter Project Name <label style="color:red">*</label></td>
<td> @Html.TextBoxFor(x => x.ProjectName)</td>
<td>
@Html.ValidationMessageFor(m => m.ProjectName, "", new { @class = "text-danger" })
</td>
</tr>
</table>
<div id="message">
</div>
<button type="submit" value="Submit" id="btnValidateForm">Submit</button>
}
}
</div>
</body>
@Scripts.Render("~/bundles/jqueryval")
</html>