Showing posts with label c#. Show all posts
Showing posts with label c#. Show all posts

Friday, April 19, 2013

How to solve HTTP 500.12 Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

Your ASP.NET may not be configured properly for IIS if you see this message:


HTTP Error 500.21 - Internal Server Error
Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list




Resolution


  1. Navigate to C:\Windows\Microsoft.NET\
  2. Open a terminal here.
  3. Type aspnet_regiis.exe -i and then enter.
  4. You should see the following if it finished correctly:
    1. Start installing ASP.NET
    2. ..........
    3. Finished installing ASP.NET
  5. Restart the IIS server.

Troubleshooting

Check the path to make sure it actually exists.

C# and JavaScript - Inheritance Examples

JavaScript uses prototypal inheritance, which is different from what we are used to in C#, Java, etc.

You can accomplish the same thing in Javascript, but with different syntax.


// JS Inheritable Class
function Animal(){
 
 this.animal_name = "";
 
 this.lengthOfToes = [];
 
 this.hasClaws = false;
 
}

// JS Inheritable Class, alternative format
var Animal = function(){};  // empty function
Animal.prototype.animal_name = "";
Animal.prototype.lengthOfToes = [];
Animal.prototype.hasClaws = false;


// creating an instance of an object
var Lion = new Animal();

// extending it
Lion.prototype.hasMane = true;

// JS Object Literal, NOT inheritable
var Animal = {

 animal_name: "Simba",
 
 lengthOfToes: [2,3,3,3,2,3,2,4,2,3],
 
 hasClaws: false
 
};

// C#
public virtual class Animal
{
 public string animal_name { get; set; }
 int[] arrProp = new int[]();
}

public partial class Lion : Animal
{
 public bool hasMane = new bool();
}