Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 527739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:54:53+00:00 2026-05-13T08:54:53+00:00

I have this user control: <%@ Control Language=C# AutoEventWireup=true CodeBehind=cite.ascx.cs Inherits=cite %> with behind

  • 0

I have this user control:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cite.ascx.cs" Inherits="cite" %>

with behind code:

[ParseChildren(typeof(Reference), DefaultProperty = "References", ChildrenAsProperties = true)]
public partial class cite : System.Web.UI.UserControl {

    public cite() {
        this.References = new ReferenceCollection();
    }

    [PersistenceMode(PersistenceMode.InnerProperty)]
    public ReferenceCollection References { get; private set; }

    protected override void Render(HtmlTextWriter writer) {
        writer.Write("<ul>");
        this.References.ForEach(reference => reference.Render(writer));
        writer.Write("</ul>");
    }
}

public class ReferenceCollection : List<Reference> { }

public abstract class Reference {
    public string Title { get; set; }
    public abstract void Render(HtmlTextWriter writer);
}

public class Book : Reference {
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public int Edition { get; set; }
    public string Place { get; set; }
    public string LocalTitle { get; set; }
    public int LocalPublished { get; set; }
    public string ISBN { get; set; }
    public int Page { get; set; }

    public override void Render(HtmlTextWriter writer) {
        writer.Write(string.Format("<li><cite><span style=\"text-transform: uppercase;\">{0}</span>, {1}. <i>{3}</i>. {4}. vyd. {5} : {6}, {7}. ISBN {8} S. {9}.</cite></li>", LastName, FirstName, Title, Edition, Place, LocalTitle, LocalPublished, ISBN, Page));
    }
}

public class Web : Reference {
    public string Site { get; set; }
    public DateTime Published { get; set; }
    public DateTime Cited { get; set; }
    public Uri URL { get; set; }

    public override void Render(HtmlTextWriter writer) {
        writer.Write(string.Format("<li><cite><i>{0}</i> [online]. {1}, {2}, [cit. {3}]. URL: &lt;<a href=\"{4}\" rel=\"nofollow\" style=\"text-decoration: none; color: black;\">{4}</a>&gt;", Title, Site, Published.ToSlashedString(), Cited.ToSlashedString(), URL));
    }
}

and I call it like this:

<asp:references runat="server">
    <asp:Web Title="F-14 Tomcat" Site="Wikipedia" Published="2005-09-23" Cited="2005-10-08" URL="http://en.wikipedia.org/w/index.php?title=F-14_Tomcat&oldid=19416063" />
    <asp:Book FirstName="David" LastName="Donald" Title="The Pocket Guide to Military Aircraft and the World's Airforces" Edition="1" Place="Praha" LocalTitle="Kapesní encyklopedie Vojenská letadla" LocalPubliched="2002" ISBN="80-7181-701-5" Page="76" />
</asp:references>

Control is also registered in web.config file. But <asp:Web /> and <asp:Book /> tags are unknown. I want just parse inner content of user control, create instances of classes (Web or Book) and add them to the control’s References property.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:54:53+00:00Added an answer on May 13, 2026 at 8:54 am

    You haven’t defined Web or Book as UserControls. They need to be defined as such before you can use them that way. Note that they can still derive from Reference, but Reference itself will need to derive from UserControl. You’ll also need to register them in your page before you can use them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 384k
  • Answers 384k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This will find the number of absences of each student,… May 14, 2026 at 11:08 pm
  • Editorial Team
    Editorial Team added an answer If you don't call StartRecognition before Run, the handler never… May 14, 2026 at 11:08 pm
  • Editorial Team
    Editorial Team added an answer How you do it depends on the geometry manager, but… May 14, 2026 at 11:08 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.