locked
ascx works fine in development (MSVC) but not on server RRS feed

  • Question

  • User1511870887 posted

    I have created a web user control (.ascx) and put it on a page (.aspx)

    Everything works fine on my development box.

    When I copy the code up to the server the page fails to load, I don't get any error, I just get a network timeout.
    If I remove the .ascx from my page and copy it back up to the server everything works fine.

    Any ideas what could be going on here?

    Thanks,

    Scott

    Tuesday, October 13, 2015 1:45 PM

Answers

  • User1511870887 posted

    Ok... so really wierd stuf going on here.

    The above didn't work.  So I added a try/catch to see if there was some kind of exception.

    public partial class CustomClasses_SimpleUserControl : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
        public string SetOrderId
        {
            set
            {
                lblMessage.Text = value;  // Works fine
            }
        }
    
        public bool RightsToAddNewNotifiers
        {
            set
            {
                try
                {
                    lblRightsToAddNewNotifiers.Visible = value;
                }
                catch (Exception e)
                {
                    lblExceptionMessage.Text = e.Message;
                }
            }
        }
    }

    Now everything worked fine on the server. 

    So, I go and remove the try catch and set the code back to the original.

    Everything still works fine on the server.  Aaaargh.....

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 20, 2015 11:24 AM

All replies

  • User753101303 posted

    Hi,

    smetzger

    network timeout

    Try to give the error message or the best English translation you can. In particular you have quite a bunch of timeout related error messages. Also do you mean that it applies at deploy time or that deployment works fine but that the page fails and that you have to deploy the ASCX file separately to make this work?

    If a deployment issue what is the deployment method, ftp ?

     

    Tuesday, October 13, 2015 1:58 PM
  • User1511870887 posted

    Everything works fine on my local box when running in MSVC.
    Copy (using windows explorer) everything up to an IIS Server and it does not work (but only for pages which have the .ascx  control).

    There is no error message.

    Browser comes back with Network Error A communication error occurred: ""

    Server log shows..

    2015-10-13 18:11:33 140.139.153.38 GET /Interface/YourSettings.aspx - 443 4004 143.84.107.2 Mozilla/5.0+(Windows+NT+6.1;+WOW64;+rv:38.0)+Gecko/20100101+Firefox/38.0 https://riid-apps-t.detrick.army.mil/Admin/AdminMain.aspx 500 0 64 900148

    So... a GET but no POST

    debug is set to true in my web.config.  Here is the compilation section of my web.config...

    <compilation batch="false" debug="true" defaultLanguage="c#" explicit="false" tempDirectory="D:\ASP.Net.Bin" targetFramework="4.5">
          <assemblies>
      <!--SCM 3/25/2015 Added to get rid of blank ReportViewer -->
      <add assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
            <add assembly="Microsoft.ReportViewer.Common, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845DCD8080CC91" />
      
            <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
          </assemblies>
        </compilation>

    Tuesday, October 13, 2015 2:25 PM
  • User1511870887 posted

    More clues....

    A simple Custom User control works fine.
    A simple Custom control with a string property that sets the value of a label works fine.

    However, a simple custom control with a bool property that sets the Visible property of a Label exhibits the aberrant behavior.

    public partial class CustomClasses_SimpleUserControl : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
        public string SetOrderId
        {
            set
            {
                lblMessage.Text = value;  // Works fine
            }
        }
    
        public bool RightsToAddNewNotifiers
        {
            set
            {
                lblRightsToAddNewNotifiers.Visible = value; // this works fine in Visual Studio, but get a 500 error on the server
            }
        }
    }

    Tuesday, October 20, 2015 9:53 AM
  • User1511870887 posted

    Ok... so really wierd stuf going on here.

    The above didn't work.  So I added a try/catch to see if there was some kind of exception.

    public partial class CustomClasses_SimpleUserControl : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
    
        }
        public string SetOrderId
        {
            set
            {
                lblMessage.Text = value;  // Works fine
            }
        }
    
        public bool RightsToAddNewNotifiers
        {
            set
            {
                try
                {
                    lblRightsToAddNewNotifiers.Visible = value;
                }
                catch (Exception e)
                {
                    lblExceptionMessage.Text = e.Message;
                }
            }
        }
    }

    Now everything worked fine on the server. 

    So, I go and remove the try catch and set the code back to the original.

    Everything still works fine on the server.  Aaaargh.....

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, October 20, 2015 11:24 AM