title: Why method call is not happening in IIS hosted web application?
body: <p>I have this really interesting issue where I have a web page and on button click it is checking number of labels to print and warn user if it exceeds certain number of labels (100). This works perfectly OK in Visual studio but that validation method call is not occurring in IIS. I have decompiled the DLLs in IIS to make sure that method is there and logic is there to call it on button click. In IIS hosted application no matter how many labels I print it never warn users and directly call PrintLabels() method. But why ? I have tried to debug the application using Attach but IIS application never steps into validation call method. Both Visual studio and IIS application connecting to same database so it has the same data to use.</p>
  
  <pre><code> protected void btnPrintLabel_Click(object sender, EventArgs e)
          {
              string result = ValidatePrintLimit(); // This call is not happening in IIS or somehow result is always null. 
              if (string.IsNullOrEmpty(result))
              {
                  PrintLabels();
              }
              else
              {
                  infoWarning.InnerHtml = result;
                  upnlWarning.Update();
                  ScriptManager.RegisterStartupScript(this, this.GetType(), "ToggleScript", "window.setTimeout('open_warning_info_box()',500);", true);
  
              }
          }
  
      protected string ValidatePrintLimit()
      {
          string result = "";
          if (!string.IsNullOrEmpty(txtLastKeyNo.Text.Trim()) &amp;&amp; !string.IsNullOrEmpty(txtFirstKeyNo.Text.Trim()))
          {
              int lastKeyNo = int.Parse(txtLastKeyNo.Text.Trim());
              int startKeyNo = int.Parse(txtFirstKeyNo.Text.Trim());
  
              BL.PrintLimit objPL = new PrintLimit();
              DataTable allLimits = objPL.GetPrintLimits();
              int upperLimit = 0;
              int warningLimit = 0;
              if (allLimits.Rows.Count &gt; 0)
              {
                  warningLimit = Int32.Parse(allLimits.Rows[0]["WarningLimit"].ToString());
                  upperLimit = Int32.Parse(allLimits.Rows[0]["UpperLimit"].ToString());
              }
              if ((lastKeyNo - startKeyNo) &gt; warningLimit) result = "Number of label print requested : " + (lastKeyNo-startKeyNo) + "&lt;br/&gt;&lt;br/&gt;Number of labels to print exceeds warning limit of : " + warningLimit + "&lt;br/&gt;&lt;br/&gt;Do you want to proceed ? ";
          }
          return result;
      }
  </code></pre>