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

  • Home
  • SEARCH
  • 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 4041410
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T12:52:38+00:00 2026-05-20T12:52:38+00:00

I have a hyperlink that in certain cases I want to change to show

  • 0

I have a hyperlink that in certain cases I want to change to show a jquery popup, but I’m having a strange problem when doing it on a master page. The following works in a regular page:

hyp1.NavigateUrl = "#notificationPopup";

Which renders as:

<a id="ctl00_hyp1" href="#notificationPopup">Example</a>

This is exactly what I want. The problem is with the exact same code on a hyperlink on the master page it renders as:

<a id="ctl00_hyp1" href="../MasterPages/#notificationPopup">Example</a>

It looks like it might be running the navigateUrl through ResolveClientUrl() or something when I’m setting it on the master page. I’ve tried swapping the <asp:hyperlink for a <a href runat=server, but the same thing happens.

Any ideas?

  • 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-20T12:52:38+00:00Added an answer on May 20, 2026 at 12:52 pm

    There is a note on MSDN Control.ResolveClientUrl method description.

    The URL returned by this method is
    relative to the folder containing the
    source file in which the control is
    instantiated. Controls that inherit
    this property, such as UserControl and
    MasterPage, will return a fully
    qualified URL relative to the control.

    So the behavior of master page in your exampe is fully predictable (although this is not a very comfortable to work with). So what are the alternatives?

    The best one is to set the <a> as a client control (remove runat="server"); should work like a charm even in a master page:

    <a href="#notificationPopup">Example</a>
    

    In the case if this control should be server side only: you could just build an URL from your code behind by using UriBuilder class:

    UriBuilder newPath = new UriBuilder(Request.Url);
    // this will add a #notificationPopup fragment to the current URL
    newPath.Fragment = "notificationPopup";
    hyp1.HRef = newPath.Uri.ToString();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a hyperlink in my website that I want to be part #A0A0A0
I want a hyperlink that looks like a standard button. I have tried using
I have a hyperlink on a page that sends certain variables e.g. Default.aspx?var1=x&var2=y I
Every row in my gridview is supposed to have a button/hyperlink that navigates to
I thought that this was easier… I have a asp:hyperlink control, with target=_blank ,
I have a Modal Box that opens by clicking a HyperLink. In the Modal
I have this block of xaml that allows the text of a hyperlink to
I have a intranet webpage that is used to hyperlink to various files on
I have some thumbnails that I display with a Repeater, using a hyperlink and
want to have a Hyperlink-Button in a gridView in which I can display a

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.