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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:30:03+00:00 2026-06-15T06:30:03+00:00

I am trying to use an <%# Eval(name) %> to be the title of

  • 0

I am trying to use an <%# Eval("name") %> to be the title of my page. I can’t seem to figure out any solutions online. I have tried the other StackOverflow question but that did now work either.

The page is a bio.aspx and on the site it is displayed as bio.aspx?id=123 so the page title needs to vary depending on the ID. I figured I could just use the Eval(“name”) but no luck yet.

I currently am using JavaScript:

window.onload = function() {
document.title = '<%# Eval("name") %> | Title Line';
}

This works, but it still leaves the title tags empty, and it’s kind of spammy.

Here is the codebehind:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class DoctorBio : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
    Page.Title = "Your Page Title";

    HtmlMeta metaDescription = new HtmlMeta();
    metaDescription.Name = "description";
    metaDescription.Content = "brief description";
    Page.Header.Controls.Add(metaDescription);

    HtmlMeta metaKeywords = new HtmlMeta();
    metaKeywords.Name = "keywords";
    metaKeywords.Content = "keywords, keywords";
    Page.Header.Controls.Add(metaKeywords);
}
protected void SetPageTitle(object title)
{
this.Title = title.ToString();
}
protected string ReplaceLineBreaks(object text)
{
    string newText = text as string;
    if (newText == null) { return string.Empty; }
    return newText.Replace("\r\n", "<br />");
}
}
  • 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-06-15T06:30:04+00:00Added an answer on June 15, 2026 at 6:30 am

    Replace your following code
    Previous code

    this.Title = title.ToString();
    

    Replace with

    Page.Title = title.ToString();
    

    Try this one. It is working for me…

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

Sidebar

Related Questions

I'm trying to avoid the use of eval . I can dynamically instantiate a
I am trying to use Eval inside a IF Statement and Repeater. I want
i'm trying use facebook API to upload photo in my fan page. I downloaded
I am trying use gem tire to search in my application. I have tables
Hi I'm trying use a datepicker on a field I have. I'm trying to
I am trying to use phpmailer to send out a newsletter, but I keep
I have a Perl script and I am trying to make it print out
I'm trying to override globals so that any attribute name that doesn't exists returns
What I am trying to achieve is to use an Eval as parameter in
I am trying to figure out how to call a javascript function using text

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.