This question is locked. New answers and comments are not allowed.
Please Help me .. when i use Check Boxes Serverside
then i get error ..
--------------------Error--------------
Compiler Error Message: CS0433: The type 'System.Web.WebPages.HelperResult' exists in both 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.dll' and 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.dll'
-----------------------view --------------------------
@{ Html.BeginForm(); }
@{
Guid[] checkedRecords = (Guid[])ViewData["Customers"];
Html.Telerik().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Template(
@<text>
<input name="checkedRecords" type="checkbox" value="@item.UserId " title="checkedRecords"
@if (checkedRecords.Contains(item.UserId))
{
<text>checked="checked"</text>
}
/>
</text>)
.Title("").Width(36).HtmlAttributes(new { style = "text-align:center" });
columns.Bound(o => o.UserId).Width(100);
columns.Bound(o => o.UserName ).Width(200);
})
.Pageable()
.Render();
}
<p>
<button type="submit" class="t-button t-state-default">Display checked orders</button>
</p>
@{ Html.EndForm(); }
-----------------Controller----------------
then i get error ..
--------------------Error--------------
Compiler Error Message: CS0433: The type 'System.Web.WebPages.HelperResult' exists in both 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.dll' and 'c:\Windows\Microsoft.NET\assembly\GAC_MSIL\System.Web.WebPages\v4.0_1.0.0.0__31bf3856ad364e35\System.Web.WebPages.dll'
-----------------------view --------------------------
@{ Html.BeginForm(); }
@{
Guid[] checkedRecords = (Guid[])ViewData["Customers"];
Html.Telerik().Grid(Model)
.Name("Grid")
.Columns(columns =>
{
columns.Template(
@<text>
<input name="checkedRecords" type="checkbox" value="@item.UserId " title="checkedRecords"
@if (checkedRecords.Contains(item.UserId))
{
<text>checked="checked"</text>
}
/>
</text>)
.Title("").Width(36).HtmlAttributes(new { style = "text-align:center" });
columns.Bound(o => o.UserId).Width(100);
columns.Bound(o => o.UserName ).Width(200);
})
.Pageable()
.Render();
}
<p>
<button type="submit" class="t-button t-state-default">Display checked orders</button>
</p>
@{ Html.EndForm(); }
-----------------Controller----------------
public ActionResult UsersDetails(Guid[] checkedRecords)
{
checkedRecords = checkedRecords ?? new Guid[] { };
ViewData["Customers"] = checkedRecords;
ViewData["Customers"] = Membership
.GetAllUsers()
.Cast<MembershipUser>()
.Select(x => new UserDetails
{
UserId = UserDetails.Getguid(x.UserName),
UserName = x.UserName,
});
return View();
}