Archive | Web-Programming

Communication between Controllers in Angular

This one is the mother controller ($rootScope) { $rootScope.$on(‘okEditPushed’, function (event, args) { $rootScope.$broadcast(‘handleOkEditPushed’, args); }); }); Receiver sarung.controller(“ReceiverController”, function ($scope){ $scope.$on(‘handleOkEditPushed’, function (event, args) {; }); }); Sender sarung.controller(“SenderController”, function ($scope){ var willBeSent = 5; $scope.$emit(‘okEditPushed’, willBeSend); });

How can I get the root domain URI in ASP.NET?

public string FullyQualifiedApplicationPath { get { //Return variable declaration var appPath = string.Empty; //Getting the current context of HTTP request var context = HttpContext.Current; //Checking the current context content if (context != null) { //Formatting the fully qualified website url/name appPath = string.Format(“{0}://{1}{2}{3}”, context.Request.Url.Scheme, context.Request.Url.Host, context.Request.Url.Port == 80 ? string.Empty : “:” + context.Request.Url.Port, context.Request.ApplicationPath); […]

Route on mvc

Route is something relating with SEO . below is how to give Route on MVC public class HomeController : Controller { [Route(“”)] public ActionResult Index() { return View(); } [Route(“MyAccount”)] public ActionResult Account() { return View(); } } Then add this line to your RouteConfig class before the routes.MapRoute. Route

How to Revert Migration

Mistake is not a mistake if we realize it , is it? so dont worry if we make mistake during making database . so below is the steps to migrate our migration . First Look all file on migration folder , you will get something like this 201208012131302_Add-SystemCategory.cs 201207311827468_CategoryIdIsLong.cs 201207232247409_AutomaticMigration.cs 201207211340509_AutomaticMigration.cs 201207200025294_InitialCreate.cs Step 2 Through […]