How to Keep Node Updated

To update installed node package
1.) Delete nodejs folder from C:\Program Files (x86)\nodejs or location where its installed
2.) Download latest installer from https://nodejs.org/en/download/ and reinstall

To Update angular command line interface

npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest

How is ASP.Net Web Forms architecture different from ASP.Net MVC?

Web forms uses page controller or base controller design pattern where as MVC uses Front Controller design pattern.

Page Controller:

Page receives request from IIS and call controllers method. In traditional web forms all pages (View) inherit from System.Web.UI.Page class which has a code behind class acting as a controller. Continue reading

What are various Results returned by Action Methods in MVC ?

Actions in Asp.Net MVC returns ActionResult which is base class for all the results that can be returned. Below are classes that derive from ActionResult and can be returned as a result.

  • ViewResult
  • PartialViewResult
  • ContentResult
  • JsonResult
  • JavascriptResult
  • EmptyResult
  • FileResult
  • FilePathResult
  • FileContentResult
  • FileStreamResult
  • HttpNotFoundResult
  • HttpStatusCodeResult
  • HttpUnAutorizedResult
  • RedirectResult
  • RedirectPermanentResult
  • RedirectToActionResult
  • RedirectToActionPermanentResult
  • RedirectToRouteResult
  • RedirectToRoutePermanentResult

Continue reading

What’s the difference between const and readonly?

const are compile time constants where as readonly are runtime constants. Once assigned you cannot change the values assigned to variables declared as const or readonly.

Usage:

Const variable just like their static(shared in VB) counterparts are accessible via Class Names only. They are not accessible via objects.

Readonly variable are instance variable and accessible via objects. Continue reading

Automation in .Net Part 2

HttpRequest and HttpResponse Classes

Let’s try to scrape from data from my own blog i.e. www.shaktitanwar.com . We will try to extract all blog titles on home page.

There are various facets to scraping:

  1. We need to first have a URL that we need to scrape i.e. shaktitanwar.com
  2. What all data needs to be scraped? In our case it’s Blog titles.
  3. Which verb is used by the URL to show data? In our case it’s a GET request
  4. The HTTP Headers required by website to serve the content properly.

Continue reading

OOPS In VB.Net – Encapsulation – Abstraction

Introduction
OOPS or Object Oriented Programming Structures. Some of the concepts have been always used in one or the other programming languages. For example you must have used structs in C which is a good example of encapsulation. There are four major pillar of OOPS. Let’s try to understand each one of them by taking some examples also:-
1.) Encapsulation

2.) Abstraction

3.) Polymorphism

4.) Inheritance

Continue reading

Node.Js Part 1

Node.Js

 

On popular demand from many of my student and fellow developers, I am starting this series on Node.js . Focus will be on developing Node.js applications using Visual studio and side by side explaining things about other open source frameworks that go hand in hand with Node e.g. Bower, Grunt, Yeoman, Jasmine etc.

What is Node.js?

Node.js is a server side JavaScript framework. A server side framework means not only web framework like PHP,Asp.net but also something using which you can create your own servers like Apache or IIS. Using Node.js we can create networking applications on server as well. Unlike some other frameworks Node.js is completely Open source. Continue reading