Friday, May 3, 2013

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

To repair this problem I ran a full silent repair of the .NET Framework 4.0.   Here's how on either a 32 bit or 64 bit computer:
  1. Click Start -> All Programs -> Accessories -> Run
  2. In the Open textbox paste in the following line (see list of all .NET Framework version install, repair and unistall command lines ):
    For silent repair on 32 bit computer with .Net Framework version 4.0.30319 use:
    %windir%\Microsoft.NET\Framework\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart
    For silent repair on 64 bit computer with .Net Framework version 4.0.30319 use:
    %windir%\Microsoft.NET\Framework64\v4.0.30319\SetupCache\Client\setup.exe /repair /x86 /x64 /ia64 /parameterfolder Client /q /norestart
  3. Click OK to start the repair
  4. After, the repair ran for a few minutes, I restarted IIS 7.5, and things began to work correctly!
 Hopefully, that will work for you...
Some people also seem to be having success correcting this error by running aspnet_regiis.exe. I initially tried this and it did not work for me, but feel free to give it a shot. (Keep in mind for the example below I have .Net Framework version 4.0.3.0319 installed on my computer, but you may need to change directory version to what is installed on your computer):  Here's how to run aspnet_regiis.exe:
  1. Run "aspnet_regiis.exe" program from command line (within Command Prompt):
%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe –i
If you want to open it using the Run program, just type in "Run" in the Windows 7 search box, then use the following line below in the Open box, then click OK:
%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe –i
 Note if your computer is 64 bit, then I would change the line to:
%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe –i
Hopefully, these solutions help get you up and running and fix the IIS7 error...  Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list.

Create Textbox and its Change Event Dynamically

.aspx Code

  <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />

.cs Code:

using System;
using System.Windows.Forms;

namespace Musakkhir
{
    public partial class WebForm8 : System.Web.UI.Page
    {
        System.Web.UI.WebControls.TextBox t = new System.Web.UI.WebControls.TextBox();
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            t.AutoPostBack = true;
            t.TextChanged+=new EventHandler(t_TextChanged);
        }
        protected void t_TextChanged(object sender, EventArgs e)
        {
            this.Controls.Add(t);
            t.Attributes.Add("runat", "sever");
            MessageBox.Show("New text change event");
        }
    }
}