Posts

Solved- goto option of notepad disabled

I am using notepad most of time for easy way to store text of my day to day job.  But suddenly I am not able to use the go to functionality of note pad to move to specific line no. In notepad to enable goto option you need to check and act on below things. Go to format menu and check word wrap option is on or not If it is on then keep it off so that goto option will enable again. This is what the solution you can use for disable goto functionality.

Using Ng-grid in AngularJS Pages

Image
It is a common requirement for any project to display data in a tabular format. The easiest way to do this is by using HTML tables, but soon this gets complex, you need a way to support sorting (single & multi columns), resizable columns, inline editing, filtering, pagination (client-side and server-side) and so on. There is a way to bind data to a HTML Table in AngularJs, but when it comes to sorting, paging, editing and dragging the columns, the grid choice is useful. ng-grid is Angular's native implementation of the Grid. There are many plugins from third-parties that can be integrated into AngularJS Pages, but ng-grid exists inside the AngularJs framework and is very rich in functionality and compatibility. Let us create a sample ng-grid and understand how ng-grid works. To use AngularJS, you have to include it in your page before the closing <body> tag. Google's CDN is recommended for a faster load time: <script src = "https://ajax.googleapis

Dependency injection in MVC controller step by step

ASP.NET Core MVC controllers should request their dependencies explicitly via their constructors. In some instances, individual controller actions may require a service, and it may not make sense to request at the controller level. In this case, you can also choose to inject a service as a parameter on the action method. With ASP.NET 5 MVC6, we get a feature called dependency injection baked right into the framework for us.  Dependency injection is a technique that follows the Dependency Inversion Principle, allowing for applications to be composed of loosely coupled modules. ASP.NET Core has built-in support for dependency injection, which makes applications easier to test and maintain. ASP.NET Core's built-in support for constructor-based dependency injection extends to MVC controllers. By simply adding a service type to your controller as a constructor parameter, ASP.NET Core will attempt to resolve that type using its built in service container. Services are typically,

Asp.Net MVC page life cycle quick overview

There are seven main steps that happen when you make a request to an Asp.net MVC web applications. Routing Asp.net Routing is the first step in MVC request cycle. Basically it is a pattern matching system that matches the request’s URL against the registered URL patterns in the Route Table. When a matching pattern found in the Route Table, the Routing engine forwards the request to the corresponding IRouteHandler for that request. The default one calls the MvcHandler. The routing engine returns a 404 HTTP status code against that request if the patterns is not found in the Route Table. When application starts at first time, it registers one or more patterns to the Route Table to tell the routing system what to do with any requests that match these patterns. An application has only one Route Table and this is setup in the Global.asax file of the application. MvcHandler The MvcHandler is responsible for initiating the real processing inside ASP.NET MVC. MVC handler

All about tempdata in Asp.Net MVC

Image
TempData in ASP.NET MVC is basically a dictionary object derived from TempDataDictionary. TempData stays for a subsequent HTTP Request as opposed to other options (ViewBag and ViewData) those stay only for current request. So, TempData can be used to maintain data between controller actions as well as redirects. Note: Just like ViewData, typecasting and null checks required for TempData also in order to avoid errors. Let’s see how we can use TempData in a practical scenario to pass data from one controller action to another. // Controller Action 1 (TemporaryEmployee) public ActionResult TemporaryEmployee() { Employee employee = new Employee { EmpID = " 121" , EmpFirstName = " Imran" , EmpLastName = " Ghani" }; TempData[ " Employee" ] = employee; return RedirectToAction( " Per