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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:40:33+00:00 2026-05-24T15:40:33+00:00

I have some links in an UpdatePanel. For example: <a href=Products.aspx>Products</a> I also have

  • 0

I have some links in an UpdatePanel. For example:

<a href="Products.aspx">Products</a>

I also have a CSS rule that puts an icon next to off-site links (those that have an HREF that starts with “http”):

a[href^="http"]
{
    padding-right: 18px;
    background: transparent url("Icons/offsiteLink.png") no-repeat right bottom;
}

When the page loads initailly, the links correctly do not have the off-site icon. The problem is that after an Ajax postback using the UpdatePanel, the icon appears next to the links! I added a hover event to display the href attribute, and it has indeed been changed to have the full path to the page after the Ajax postback. It doesn’t matter if the links are plain HTML tags or a TreeView node.

Is this an issue with ASP.NET, or Ajax in general? Can I stop it?

Thanks.

Update:

I have created a brand new Web Site project. This is in Visual Studio 2008/.NET 3.5. Here is the entirety of the code:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Test</title>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="mainScriptManager" runat="server" />
    <asp:UpdatePanel ID="updatePanel1" runat="server">
        <ContentTemplate>
            <p><a id="internalLink" href="About.aspx"
                onmouseover="$('#hrefValue').text($(this).attr('href'));">About</a></p>
            <p><a id="offsiteLink" href="http://example.com/"
                onmouseover="$('#hrefValue').text($(this).attr('href'));">Offsite</a></p>
            <p>HREF: <span id="hrefValue"></span></p>
            <asp:Button ID="submitButton" Text="Post Back" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
    </form>
</body>
</html>

(The code behind is empty.)

When I load the page in IE 7 and hover the links, I get:

  • About.aspx
  • http://example.com/

Then, I click the button, and hover the links again. This time they are:

  • http://localhost:4069/TestSite/About.aspx
  • http://example.com/

Notice that the first one changed to the full path.

  • 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-24T15:40:34+00:00Added an answer on May 24, 2026 at 3:40 pm

    It turns out that this was caused by an issue with IE7. IE8 no longer has the issue.

    Due to several factors, I decided to use JavaScript to fix it. Here is that code. I also included a snarky comment about my company still targeting IE7 😉

    company.offsiteIconFix = (function() {
    
        function init() {
            var i, allAnchors = document.getElementsByTagName("a");
    
            for (i = 0; i < allAnchors.length; i++) {
                if (allAnchors[i].hostname && allAnchors[i].hostname ===
                    location.hostname) {
                    var trimIndex = allAnchors[i].href.indexOf(allAnchors[i].host) +
                        allAnchors[i].host.length;
                    var trimmedUrl = allAnchors[i].href.substring(trimIndex);
                    allAnchors[i].setAttribute("href", trimmedUrl);
                }
            }
        }
    
        return {
            init: init
        };
    })();
    
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(company.offsiteIconFix.init);
    

    I could change it to insert “rel=external” as suggested by mgnoonan.

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

Sidebar

Related Questions

I have an update panel on my page with some links that have onClick
Does anyone have some helpful links to find out about Android Uri's? For example,
Does anyone have some guidelines or links to articles when designing a website that
I have some jQuery code that intercepts links clicked on a page: $(document).ready(function() {
I have some text that has HTML hyper-links in it. I want to remove
I have a HAML page that lists some links to delete things that looks
I'm asking this because I have some links that act like buttons that pull
Greetings, I have an asp.net mvc application. I have some links that corresponds to
i have some links in my page < a class=Qlink rel=20;5 href=javascript:void(0);>5</a> < a
On my web page i have some links like : <div id=toolbarButtons> <a href=actualites/addLink

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.