Solved

ASP.Net web page does not display ascx customcontrol but I can see the control contents when I "View Source"

Posted on 2014-01-29
2
736 Views
Last Modified: 2014-02-10
I have an existing ASP.Net website project that has just been handed over to me. This project has an initial login.aspx page that, in addition to the typical username and password fields,  is supposed to display a custom user control at the bottom that shows a clickable image that is a link to http://www.livehelpnow.net.

I was told that this image link was visible as recently as last Friday (1/24/14). Now, when you view the page, you do not see the image or the link.

I have checked file dates on all of the files and none of them have a date modified stamp more recent than 1/13/14

If I view source for the page, I can see the Span and Divs associated with the control. It is just not showing up on the actual page.

Here is a link to the login page

https://secure.confirmdelivery.com/MAILNet/Login.aspx

The custom user control is listed at the bottom of the login.aspx page as follows;


--------start snip---------------------------------------------------------
                     </form>
        </center>
        <UserControls:OnlineHelp id="ucOnlineHelp" runat="server"></UserControls:OnlineHelp>
       </BODY>
</HTML>
-------- end snip---------------------------------------------------------

The custom control is referenced in the web.comfig, <system.web><pages><controls> section, as follows;

--------start snip---------------------------------------------------------

<add tagPrefix="UserControls" src="~/CustomControls/ctlOnlineHelp.ascx" tagName="OnlineHelp"/>

-------- end snip---------------------------------------------------------


Below is the contents of the ctlOnlineHelp.ascx file;


--------start snip---------------------------------------------------------

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ctlOnlineHelp.ascx.vb" Inherits="MAILnet.ctlOnlineHelp" %>

<asp:Label ID="lblOnlineHelp" runat="server" Text="OnlineHelp"></asp:Label>

-------- end snip---------------------------------------------------------

Listed below are the contents of the code-behind file, ctlOnlineHelp.ascx.vb.

--------start snip---------------------------------------------------------

Imports System.Configuration.ConfigurationManager
Imports System.Text

Public Class ctlOnlineHelp
    Inherits System.Web.UI.UserControl

#Region " Protected Methods "
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            Me.lblOnlineHelp.Text = DHO.ReadFile(DHO.gSiteRoot & DHO.GetBrandingSession.BrandingFilePath & "Scripts\OnlineHelp_V3.js")
        Catch ex As Exception
            Throw New Exception(ex.Message)
        End Try
    End Sub
#End Region

End Class

-------- end snip---------------------------------------------------------

So, the label in the custom control is being filled with the OnlineHelp_v3.js

I can see all of the above code, including the contents of the OnlineHelp_v3.js, played out when I select "view source" for the login.aspx page.

What is preventing it from displaying on the actual page?

Thanks in advance,

Dave
0
Comment
Question by:dcadler
2 Comments
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 500 total points
ID: 39819680
Which browser (version) are you having this issue?
I checked your link with IE9 and it is displaying the icon as Offline in the RHS of the page.

You may have a browser incompatibility issue (Check if the browser has been updated recently). I will also check if the user control is throwing any exceptions.
0
 

Author Closing Comment

by:dcadler
ID: 39848727
Actually, The problem was related to a missing image file. When I contacted the livehelp vendor, they were able to tell me what file was missing. When I replaced the image file, it started working.
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question