title: Click Event not working IIS 7.5
body: <p>I have a classic asp website using IIS 7.5. I have created a .NET application inside of the classic asp website. I have noticed clicking a submit button doesn't fire an event. It works when I debug but that's it. I have enclosed some code below.</p>
  
  <p>MASTER PAGE (This calls a classic asp page to check if the user is logged into the classic part of the website)</p>
  
  <pre><code>        #if !DEBUG
              if (Request.Cookies["sessionInfo"] != null)
              {
                  HttpCookie cookie = Request.Cookies.Get("sessionInfo");
                  bool temp;
                  cookie.Name = "sessionInfo";
  
                  if (bool.TryParse(cookie["PortalManagement"], out temp))
                  {
                      Session["PortalManagement"] = bool.Parse(cookie["PortalManagement"]);
                      cookie.Expires = DateTime.Now.AddDays(-1);
                      Response.Cookies.Add(cookie);
                      Logon();
                  }
                  else
                  {
                      Response.Redirect(ConfigurationManager.AppSettings["PricingDesk"]);
                  }
              }
              else
              {
                  Response.Redirect(String.Format("{0}loginSession.asp?cPage={1}", ConfigurationManager.AppSettings["PricingDesk"], Request.Url.AbsolutePath));
              }
          #endif
  </code></pre>
  
  <p>ASPX Page (just a button)</p>
  
  <pre><code>    &lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"&gt;
      &lt;/asp:Content&gt;
      &lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"&gt;
          &lt;asp:Button ID="btnClick" runat="server" Text="Click" OnClick="btnClick_Click" /&gt;
      &lt;/asp:Content&gt;
  </code></pre>
  
  <p>Code Behind</p>
  
  <pre><code> protected void btnClick_Click(object sender, EventArgs e)
   {
       Response.Write("&lt;script language=javascript&gt;alert('ERROR');&lt;/script&gt;");
   }
  </code></pre>
  
  <p>WEBCONFIG (of .NET site)</p>
  
  <pre><code>&lt;configuration&gt;
    &lt;appSettings&gt;
      &lt;add key="Database" value="Min Pool Size=5;Max Pool Size=40;Connect Timeout=40;Server=&lt;serv&gt;;uid=&lt;username&gt;;pwd=&lt;pass&gt;;database=&lt;db&gt;"/&gt;
      &lt;add key="PricingDesk" value="http://address/"/&gt;
    &lt;/appSettings&gt;
    &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.5" /&gt;
      &lt;httpRuntime targetFramework="4.5" /&gt;
      &lt;customErrors mode="Off"&gt;&lt;/customErrors&gt;
    &lt;/system.web&gt;
    &lt;system.webServer&gt;
      &lt;defaultDocument&gt;
        &lt;files&gt;
          &lt;add value="home.aspx"/&gt;
        &lt;/files&gt;
      &lt;/defaultDocument&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>WEBCONFIG (classic or main website)</p>
  
  <pre><code>&lt;configuration&gt;
      &lt;system.webServer&gt;
          &lt;defaultDocument&gt;
              &lt;files&gt;
                  &lt;remove value="default.aspx" /&gt;
                  &lt;remove value="iisstart.htm" /&gt;
                  &lt;remove value="index.html" /&gt;
                  &lt;remove value="index.htm" /&gt;
                  &lt;remove value="Default.asp" /&gt;
                  &lt;remove value="Default.htm" /&gt;
                  &lt;add value="Pricingdesk.asp" /&gt;
              &lt;/files&gt;
          &lt;/defaultDocument&gt;
          &lt;httpErrors errorMode="DetailedLocalOnly" defaultPath="/errorPages/unknownerror.asp" defaultResponseMode="ExecuteURL"&gt;
              &lt;remove statusCode="401" subStatusCode="-1" /&gt;
              &lt;remove statusCode="403" subStatusCode="-1" /&gt;
              &lt;remove statusCode="405" subStatusCode="-1" /&gt;
              &lt;remove statusCode="406" subStatusCode="-1" /&gt;
              &lt;remove statusCode="412" subStatusCode="-1" /&gt;
              &lt;remove statusCode="502" subStatusCode="-1" /&gt;
              &lt;remove statusCode="501" subStatusCode="-1" /&gt;
              &lt;remove statusCode="500" subStatusCode="-1" /&gt;
              &lt;remove statusCode="404" subStatusCode="-1" /&gt;
              &lt;error statusCode="404" prefixLanguageFilePath="" path="/errorPages/pagenotfound.asp" responseMode="ExecuteURL" /&gt;
              &lt;error statusCode="412" prefixLanguageFilePath="" path="/errorPages/pagenotfound.asp" responseMode="ExecuteURL" /&gt;
              &lt;error statusCode="406" prefixLanguageFilePath="" path="/errorPages/pagenotfound.asp" responseMode="ExecuteURL" /&gt;
              &lt;error statusCode="405" prefixLanguageFilePath="" path="/errorPages/pagenotfound.asp" responseMode="ExecuteURL" /&gt;
              &lt;error statusCode="403" prefixLanguageFilePath="" path="/errorPages/pagenotfound.asp" responseMode="ExecuteURL" /&gt;
              &lt;error statusCode="401" prefixLanguageFilePath="" path="/errorPages/pagenotfound.asp" responseMode="ExecuteURL" /&gt;
              &lt;error statusCode="500" path="/errorPages/unknownerror.asp" responseMode="ExecuteURL" /&gt;
              &lt;error statusCode="500" subStatusCode="100" path="/errorPages/unknownerror.asp" responseMode="ExecuteURL" /&gt;
              &lt;error statusCode="501" path="/errorPages/unknownerror.asp" responseMode="ExecuteURL" /&gt;
              &lt;error statusCode="502" path="/errorPages/unknownerror.asp" responseMode="ExecuteURL" /&gt;
          &lt;/httpErrors&gt;&lt;/system.webServer&gt;
      &lt;system.web&gt;
          &lt;compilation batch="true" explicit="false" debug="true" targetFramework="4.0"&gt;
          &lt;/compilation&gt;
          &lt;pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" /&gt;&lt;/system.web&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I've been searching all day for an answer and I hope someone out there smarter than me can figure it out!</p>
  
  <p>Thanks in advance!</p>