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 7175211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:14:15+00:00 2026-05-28T16:14:15+00:00

I have this code in my ASP page: <%@ Register TagPrefix=genies Namespace=TheNamespace Assembly=TheAssembly%> …

  • 0

I have this code in my ASP page:

<%@ Register TagPrefix="genies" Namespace="TheNamespace" Assembly="TheAssembly"%>

...

<% string name = GetTag().Name; %>
<div class="<%= name %>"></div>
<genies:BarGenie ID="BarGenie1" runat="server" Title="<%= name %>" />

The BarGenie class has the following code:

public class BarGenie : Control {

    public string Title { get; set; }

    protected override void Render(HtmlTextWriter writer) {
        writer.Write("<div>" + Title + "</div>");
    }

}

This is the HTML that is generated:

<div class="E00383"></div>
<div><%= name %></div>

I’d like to see this HTML:

<div class="E00383"></div>
<div>E00383</div>

I’ve tried various things in the ASPX code: @name, <%# name %> etc but I can’t figure out what’s going on. Is there some other way of inserting a custom control that I should be using? Do I have the wrong approach to using this custom control?

  • 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-28T16:14:17+00:00Added an answer on May 28, 2026 at 4:14 pm

    Try this replacing the <%= %> tags with <%# %> and adding a call to this.DataBind(); in your codebehind.

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

Sidebar

Related Questions

In code-behind of an ASP.NET page I have this method: public string TestFunc() {
I have this following code, here CssClass is of the String type. <asp:Panel ID=Panel1
I have a Page in ASP.net and UserControl that I register in this page.
<%@ Page Language=C# AutoEventWireup=true CodeFile=Test.aspx.cs Inherits=Test %> <%@ Register Assembly=AjaxControlToolkit Namespace=AjaxControlToolkit TagPrefix=cc1 %> <!DOCTYPE
I have this code in my ASP.NET application written in C# that is trying
I have this code: <asp:RadioButtonList ID=rblExpDate runat=server > <asp:ListItem Selected=True Text=No expiration date></asp:ListItem> <asp:ListItem
With ASP .NET MVC3. In my controller I have this portion of code MasterMindDnetEntities
I have HTML code like this: <asp:LinkButton ID=AddButton runat=server OnClick=AddPatientBtn_Click> <span class=Normal>Add</span> </asp:LinkButton> I
This is a beginner level question for asp.net MVC I have the following code
So I have some code that looks like this: <asp:BoundField DataField=CreatedOn HeaderText=Created on SortExpression=CreatedOn

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.