asp.net-mvc-5

Does Grid.MVC work with ASP.NET MVC 5?

旧时模样 提交于 2019-12-02 06:22:56
Before I start messing around with something that doesn't work: Does Grid.MVC work with ASP.NET MVC 5? On gridmvc.codeplex.com they just write MVC3/4, but I wonder if anybody tried it with MVC5? You tried it, but it didn't work? Did you use any free alternative? Any help appreciated! Thanks! Try this one: http://mvc-grid.azurewebsites.net it is more up-to-date. MVC 5: Install-Package NonFactors.Grid.Mvc5 MVC 6: Install-Package NonFactors.Grid.Mvc6 Yes it works in MVC5. The website does not indicate 3+ but that's what it is. I have implimented Grid.Mvc in multiple MVC5 projects using EF6. I

How can I refresh partial view and the main view at the same time?

时光总嘲笑我的痴心妄想 提交于 2019-12-02 05:55:12
问题 1) Here is the controller method of my main view: public ActionResult PredefPageLoad() { List<PredefineViewsView> predefViewsViews = null; try { using (PanSenseEntities context = new PanSenseEntities()) { int userID = Convert.ToInt32(Session["LoggedUserID"]); predefViewsViews = (from x in context.PredefineViewsViews where x.UserID == userID select x).ToList(); } } catch (Exception e) { Console.WriteLine(e); } return View(predefViewsViews); } 2) So my main view is displays a web grid which

How to inject User Manager to Account Controller with default Identity Model in Identity 2 using Ninject

末鹿安然 提交于 2019-12-02 05:54:00
问题 I use Ninject on a MVC 5 project with Identity 2. For rest of data context and controllers using that I have no problems with dependency injection. For Account controller that uses Identity 2 model I'm getting null UserManager when I try to login: public class AccountController : Controller { private ApplicationUserManager _userManager; public AccountController() { } public AccountController(ApplicationUserManager userManager) { UserManager = userManager; } public ApplicationUserManager

Default datetime picker in visual studio 2015 showing only date picker not allowing to select time

橙三吉。 提交于 2019-12-02 05:51:14
问题 I am using visual studiio 2015 and i am using its default datetime picker in my MVC5's App. i am facing problem while showing the datetime picker. it is showing only date picker and not time picker. but i need time picker also. here is my code of datetimepicker in model [DataType(DataType.Date)] [DisplayFormat(DataFormatString = "{0:yyyy-MM-dd}", ApplyFormatInEditMode = false)] [Required(ErrorMessage = "Start DateTime is required")] public Nullable<System.DateTime> start_date_time { get; set;

How to hide and show div in asp.net mvc 5 using dropdownlist change event

强颜欢笑 提交于 2019-12-02 05:19:08
I am trying to hide and show div in my mvc 5 project using dropdownlist change event, i have researched, and luckily i found this code online, but it doesn't seem to work for me, i will appreciate if anyone could point at where i am making mistakes. Thanks in advance. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> <script type="text/javascript"> $(function () { $(document).ready(function () { $("#CountryID").change(function () { if ($(this).val() == "Ghana") { $("#showStateLga").show(); $("#showStateLgaText").hide(); } else { $("

The type or namespace name 'Models' does not exist in the namespace 'PartyInvites'

孤街浪徒 提交于 2019-12-02 05:15:15
Using VS2013 Pro, TFS 2013 Express I'm currently doing a tutorial from the book asp.net mvc 5 and everything was fine. yesterday I installed TFS 2013 Express onto my local machine, copied the project over to the TFS folder and added the project to source control. Since doing that I'm now getting errors like the subject. In this case the controller simply has a using: using System.Web; using System.Web.Mvc; using PartyInvites.**Models**; namespace PartyInvites.Controllers { public class HomeController : Controller { // GET: Home //public ActionResult Index() //{ // return View(); //} public

MVC Route Map Got Exception on Html.RenderAction : No route in the route table matches the supplied values

六眼飞鱼酱① 提交于 2019-12-02 05:13:05
I use ASP.NET MVC 5 and this is My Route Map for all of the actions except Home/index : routes.MapRoute( name: "randomNumber", url: "{controller}/{randomNumber}/{action}", defaults: new { }, constraints: new { randomNumber = @"\d+" } ); And for first page: Home/Index I don't want to use {randomNumber} So the first solution I think is: routes.MapRoute( name: "Default", url: "{controller}/{action}", defaults: new { controller = "Home", action = "Index" } ); This route map solve my problem, but caused another problem that is: clients can access to other actions without {randomNumber} , but I just

MVC HttpRequestValidationException exception

泪湿孤枕 提交于 2019-12-02 04:35:33
I am coding a MVC 5 internet application and have a question in regards to the HttpRequestValidationException exception. My previous code in my controller is as follows: protected override void OnException(ExceptionContext filterContext) { // Make use of the exception later this.Session["ErrorException"] = filterContext.Exception; if (filterContext.Exception is HttpRequestValidationException) { TempData["UITitle"] = "Validation"; TempData["UIHeading"] = customErrorType; TempData["UIMessage"] = filterContext.Exception.Message; TempData["UIException"] = filterContext.Exception; filterContext

ASP.NET MVC Routes: How do I omit “index” from a URL

喜欢而已 提交于 2019-12-02 04:23:43
I have a controller called "StuffController" with a parameterless Index action. I want this action to be called from a URL in the form mysite.com/stuff My controller is defined as public class StuffController : BaseController { public ActionResult Index() { // Return list of Stuff } } I added a custom route so the routes are defined like this: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); // Custom route to show index routes.MapRoute( name: "StuffList", url: "Stuff", defaults: new { controller = "Stuff", action = "Index" } );

Design First Datetime Key. My scaffolded controller is finding MM/dd/yyyy instead of dd/MM/yyyy

梦想的初衷 提交于 2019-12-02 04:21:10
Would like some help please: Design First (Access Conversion) Composite Key is CalendarDate and Round. From Index.cshtml <tbody> @foreach (var item in Model) { <tr> <td> @Html.DisplayFor(modelItem => item.CalendarDate) </td> <td> @Html.DisplayFor(modelItem => item.Round) </td> <td> @Html.DisplayFor(modelItem => item.SundayComp) </td> <td> @Html.ActionLink("Edit", "Edit", new { CalendarDate = item.CalendarDate.ToString("dd/MM/yyyy"), Round = item.Round }) | @Html.ActionLink("Delete", "Delete", new { CalendarDate = item.CalendarDate.ToString("dd/MM/yyyy"), Round = item.Round }) </td> </tr> } <