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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:17:43+00:00 2026-05-27T03:17:43+00:00

I have a User Control which is dynamically placed by CodeBehind as follows: Dim

  • 0

I have a User Control which is dynamically placed by CodeBehind as follows:

    Dim myControl As Control = CType(Page.LoadControl("~/Controls/mainMenu.ascx"), Control)
    If InStr(Request.ServerVariables("url"), "/Login.aspx") <= 0 Then
        mainMenu.Controls.Add(myControl)
    End If

As per an example from my previous question on here.

Within this Control is a repeater which calls a database to generate values.

My Repeater mark-up is as follows

<asp:Repeater runat="server" ID="locationRepeater" OnItemDataBound="getQuestionCount">                        
    <ItemTemplate>
       <p id='locationQuestions' title='<%# Container.DataItem %>' runat='server'></p>
    </ItemTemplate>
</asp:Repeater>

The example above works fine, but I want to be able to prepend text to <%# Container.DataItem %> in the title attribute of that <p> to print to the browser like this is some text DATA_ITEM_OUTPUT

When I try to do that though, it prints this is some text <%# Container.DataItem %> exactly like that, ie, turning <%# Container.DataItem %> into text, NOT the value from the repeater code.

It was working fine before I made it into a dynamically inserted control, so I am thinking I might have something being generated in the wrong order, but given that it works without any prepended text, I am stumped to fix it!

I’m new to .net and using vb.net, please could someone point me in the right direction?

  • 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-27T03:17:44+00:00Added an answer on May 27, 2026 at 3:17 am

    It would help to see the broken version of your code, but I gather you’re doing this:

    <p id='locationQuestions' title='This is some text <%# Container.DataItem %>' runat='server'></p>
    

    If that’s the case, try it like this:

    <p id='locationQuestions' title='<%# "This is some text " & Container.DataItem %>' runat='server'></p>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page in which I am loading a user control dynamically as
I have a usercontrol called MyUserControl.xaml which dynamically adds another user control: UserControl myControl
I have a user control which is being loaded to the page dynamically after
I have a nested user control which appears on every single page. It contains
I have created a web user control (MemberDetails.ascx) which is loaded dynamically on a
I have created user control container (panel actually) which dynamically adding and removing user
I have a User Control which renders a simple drop downList into the page.
I have made a form which adds controls dynamically with user selecting the type
I have a webform which dynamically loads a web user control in it. Within
I have a webform which dynamically loads a web user control in it. Within

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.