Help needed working on someone's code that was not written in visual studio

Posted on 2006-05-21
Last Modified: 2008-01-09
 I am taking over someone else's code and i have come across some code i have not seen before

When i load the default page i get this message

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: The base class includes the field 'title', but its type (System.Web.UI.HtmlControls.HtmlContainerControl) is not compatible with the type of control (System.Web.UI.HtmlControls.HtmlTitle).

Source Error:

Line 19: <html xmlns="" xml:lang="en" lang="en">
Line 20: <head runat="server">
Line 21:       <title id="title" runat="server">Rural Meeting Place- Home Page</title>
Line 22:       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
Line 23:

This is the src for the default page...<%@Page src="pageTemplate.aspx.vb" inherits="PageTemplate" validateRequest="false" %>

This is taken from PageTemplate.vb

public mustinherit Class PageTemplate
      inherits System.Web.UI.Page

      protected title as HtmlContainerControl

When i change the type of title to (System.Web.UI.HtmlControls.HtmlTitle) i then get a different error:

'innerText' is not a member of 'System.Web.UI.HtmlControls.HtmlTitle'.
dtr = cmd.executeReader()
title.innerText = dtr("pagetitle").toString()
description.Attributes("content") = dtr("metadescription")
keywords.Attributes("content") = dtr("metakeywords")

Do you know how i can fix this? I have never used htmltitle before. Thanks
Question by:andieje
    1 Comment
    LVL 3

    Accepted Solution


    instead try
    System.Web.UI.HtmlControls.HtmlGenericControl Title

    "The HtmlGenericControl provides an ASP.NET server control implementation for all unknown HTML server control tags not directly represented by a specific HTML server control (for example, <span>, <div>, <body>, and so on)."
    per Microsoft docs


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    760 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

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now