Home » Asp.net

How to stop a border around a Hyperlink Image

I have a hyperlink Image and I can't seem to get it to stop displaying an outline around the hyperlink.  Not sure why...  Heres my code...and setting the borderstyle or borderwidth is doing nothing.

<asp:HyperLink ID="HyLinkDetails" runat="server" 
                                                                NavigateUrl='<%# Eval("OrderURL") %>' BorderStyle="None" BorderWidth="0px">Details</asp:HyperLink>



8 Answers Found


Answer 1

I don't see any difference with border for hyperlink. It seems like button details has something to do with the border.


Answer 2

No button_details.gif has no blue border around the image.

Its putting a blue image around the entire gif.  

I think it may have something to do with the "whole" style sheet.  Like maybe hyperlink colors has been defined for the whole page already or something like that....but not sure.

This ??

a:link, a:visited
    color: #034af3;
    text-align: left;



Answer 3

Here is a screenshot  of the blue line around the hyperlink based button

And here is the image by itself


Answer 4

I think somewhere generic border is defined for hyperlinks. Search for border in your stylesheet.

Stylesheet might be having a css like this



Answer 5

Its very aggrevating because nothing I'm doing is making a difference.

I coraled all of the a links together and commented them all out from the style sheet= No change.

I don't understand why setting the properties directly in the object won't override any thing else in the page.

I don't see the blue line in the design GUI of Visual Develper ONLY in IE....so that also is beyond strange. 


Answer 6

Please try this n let me know

outline: none;

-moz-outline-style: none;


Answer 7

Thanks...I tried both of those things in the style sheet and it didn't have any effect 


Answer 8

Ok, this was a hard problem.  I found the solution here: http://www.codeproject.com/Tips/115565/Remove-blue-border-when-image-is-inside-the-hyperl.aspx

I had to add this to the style sheet

a img 
    border: none;





Crystal Reports Questions :

1- How to create page border and

2- How to use watermark or backgrond image

  3- A field of datatype Int32 appears without leading zeroes even though I specified that zeroes should not be suppressed in the report designer format window. Any workaround?



Hi all,

I'm starting with silverlight and C#, and I can't seem to get how to do this.

I have several images (48x48) generated in the beggining with events attached, like this:

            Uri uri = new Uri("images/grass.jpg", UriKind.Relative);
ImageSource source = new System.Windows.Media.Imaging.BitmapImage(uri);

for (int i = 0; i < 20; i++)
for (int j = 0; j < 20; j++)
Image image = new Image();
image.Width = image.MaxWidth = 48;
image.Height = image.MaxHeight = 48;
image.SetValue(Image.SourceProperty, source);
image.SetValue(Canvas.ZIndexProperty, j);

tt.X = i * 48;
tt.Y = j * 48;

image.MouseLeftButtonUp += new MouseButtonEventHandler(DoMouseLeftUpClick);


And now I would like to create a red border around the image, whenever I click it;

I've tried this

        void DoMouseLeftUpClick(object sender, MouseEventArgs e)
Image img = sender as Image;
Border border = new Border();
border.Width = border.Height = 48;
border.BorderBrush = new SolidColorBrush(Colors.Red);
border.BorderThickness = new Thickness(1);
border.Child = img;

But nothing happens :S

edit: Map is <Canvas x:Name="Map"></Canvas>

edit: ok this happens

Error: Unhandled Error in Silverlight Application Value does not fall within the expected range.   at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
   at MS.Internal.XcpImports.SetValue(IManagedPeerBase obj, DependencyProperty property, DependencyObject doh)
   at System.Windows.DependencyObject.SetValue(DependencyProperty property, DependencyObject doh)
   at System.Windows.Controls.Border.set_Child(UIElement value)
   at SilverlightApplication1.MainPage.DoMouseLeftUpClick(Object sender, MouseEventArgs e)
   at MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
Source File: http://localhost:61160/SilverlightApplication1TestPage.aspx
Line: 0


I am using the following code for a graphical site:

<asp:HyperLink ID="lnkLogin" runat="server" BorderWidth="0px" BorderStyle="None" NavigateUrl="javascript:uimLogin.Show()" ImageUrl="~/Images/ico-login.gif"></asp:HyperLink>

In .NET 3.5 and Visual Studio 2008 this process worked fine.  I am trying to use Visual Studio 2010 .NET 4.0 to convert the site, and now my formatting is incorrect.  All hyperlink images show up with a 2px border around them.  I have tried CCS and Border attributes to try and remove the border and nothing seems to work.

I have not found anyone else having this problem, so I am wondering does anyone have a solution, or another method for doing this without loosing my formating?





In the below XAML code, the border for StackPanel "sp2" overlaps with the border for StackPanel "sp1". The overlapped region has border thicker than the non-overlapped region. SnapsToDevicePixels does not help. When SnapsToDevicePixels="false", the border bulges outwards. Otherwise, it bulges inwards.

How can I avoid the border bulging or thickening at the overlapped region? I cannot avoid the overlapping border.

<!--  XAML Code      -->

<Window x:Class="WpfApplication1.Window1"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300">
    <Grid >
            <Border Margin="30,50,30,3" SnapsToDevicePixels="False" BorderThickness="2,2,2,0" BorderBrush="Black">
                <StackPanel Name="sp1" MinHeight="50" MinWidth="50" />
            <Border Margin="30,-30,30,3" BorderThickness="2,0,2,2" SnapsToDevicePixels="false" BorderBrush="Black">
                <StackPanel Name="sp2" MinHeight="50" MinWidth="50"/>
<!--   end XAML Code  -->

Thanks you.

Kind Regards,


I'm just trying to apply a specific border color to a GroupBox. However, I notice that WPF seems to put a border around the border. So, if the actual border is a 2px blue border, WPF puts a 2px white border around the inner and outer edges of the border. I haven't found a way to disable this additional border.

Basically, I want to create a GroupBox that doesn't have this additional white border going around it.



Is anyone aware of a declarative way to do this?

Basically, I want to get the path of an inner border as a clip area for an outer border - this is for a floating window that's semitransparent.

I've nested a border on top of another border so that I can have a small thin coloured area between the two borders for the window grip area. I want the grip area to be coloured but I don't want the colour to show underneath the background area of the nested border - the best way I can think of is to clip the central background of the outer border to the path of the inner border.

I don't want to split the border up into multiple components and create a 9 slice grid - I'd rather it worked like this

Thanks for any help

I want to develop a page where there are two or more images side by side and they should be hyperlinks each to a different link which webpart is best suitable and how do I do that in Moss 2007 I want to use webparts for this instead of plain html

I have created a report using Reporting Services and exported it to Excel. Now I am running an SSIS Script Task on it to do the following:

1.Rename the worksheets from Sheet1, Sheet2 etc to something more meaningful.

2. (Trying to) add hyperlinks to images (logos) that will link to another worksheet in the same excel.

I have not been able to accomplish (2) ! Any leads on this much appreciated!



I have created a table with background images. I want to insert hyperlinks in one of the cell backgrounds. I am unable to find the use map parameter for TD background images. Below is the code.

<table width="950px" border="0" cellpadding="0" cellspacing="0">
                <td width="37px" height="124px" style="background-image: url(images/UpdatesBackground_01.jpg)">
                <td width="881px" height="124px" style="background-image: url(images/UpdatesBackground_02.jpg)">
                <td width="32px" height="124px" style="background-image: url(images/UpdatesBackground_03.jpg)">


I want to insert hyperlinks for image in bold in the above code.

Please suggest.



MODIW worked great until today.  Normally, I print, I give the doc a name and it creates the .mdi file.  Today, when I tried to print to MODIW, a printer popped up in the system tray and said "0 documents pending."  And my doc wasn't created.  I experimented a little but it failed every time.

I tried to fix this.  The first thing I did was follow instructions (like these) to create add a new printer:

1. Go to Control panel - Printer and fax
2. Add Printer - select local printer attached (Unselect detect Plug N Play)
3. In the port option select Microsoft Document Image Printer Writer Port
4. Select and install a generic manufacturer and use text only printer.
5. Right-click on the generic text/only printer driver and select properties.
6. Click on ports and select "Microsoft Office Document Imaging Driver Port".
7. Click on the advanced tab and change the driver to Microsoft Office Document Image Writer.
8. Click on apply and OK.

After I did that, the only difference was that the printer in the system tray said "1 document pending" and for a few seconds, my document showed up in the directory with 0KB.  Then it disappeared, and the printer in the system tray said "0 documents pending" just like before. 

Then I followed instructions similar to these, to uninstall and reinstall:

1. Close all running applications. If you have any Office applications running, the driver will not be installed properly.
2. Go to the "Control Panel" and "Add or Remove Programs".
3. Click on"Microsoft Office 2003" and then click on "Change".
4. Check "Add or Remove Features" and click "Next".
5. On the bottom of the page check "Choose advanced customization of applications." and click "Next".
6. Under Microsoft Office click on the + sign in front of "Office Tools"
7. Locate "Microsoft Office Document Imaging", click the icon and select "Not Available".
8. Click on "Update". This will uninstall the MODI driver.
9. Repeat steps 1 to 6 to go back to the same location you were before.
10. Locate the object "Microsoft Office Document Imaging", click the icon and select "Run from My Computer".
11. Click on "Update".

But this didn't fix the problem, either.  And I still get the printer in the system tray that tells me 0 documents are pending.

Please, if anyone has any other ideas.  It's worked great for years - I have no idea what happened.  Thanks.

This is a wierd situation... Outlook just cannot display images. I know and have not selected "dont download pictures..." in trust center. Any guess? thank you

I have a custom DLL that has a function that takes a string and returns a raster image(PNG) of a Code 128 barcode. That works fine, no problem. The barcode rendered does *not* use a font, it physically renders rectangles with precise pixel widths to generate the barcode. This is necessary because the laser expects a discrete stop of a "bar" and beginning of a "space".

-- Image properties->Size is set to "Original Size"

So I look at the report viewer, and I see barcodes. Cool. HOWEVER ... when I zoom in at about 400% I start to see blurring at the edges of the bars. It also prints this way. This is unacceptable.

So then, within report viewer, (this is the same report!) I export the report to PDF. No blurring, not at 500%, not at 2000% not at any zoom level. In the PDF, there is a sharp, precise, quantum drop from black to white with *no* blurring whatsoever. On pixel is 0x000000 and the next is 0xFFFFFF. The PDF also prints this way. This is correct behavior.

I cannot have the user export the report to PDF before printing it. This is a production shop, and I can't have folks taking twice as long to do a task.

MY QUESTION: How do I instruct, how do I force SSRS to simply render the image as I have presented it and not tinker with it?

This is a bit annoying. If my function returns a 200x50 image, SSRS may trust that that is what is to be displayed. I do not want it feathered, enhanced, pixelated, blurred, skrunkled, folded, spindled, mutilated, spozzled, or chinked. I do not want spuzzling, bopling, prinkling, dazzling or snubnation. Neither do I want any spabbits, nurplets, or boppling or any of that business. I wish to say to SSRS: "Hey SSRS, when you print this, don't attempt to "improve" the image. Just read the image and stamp it on the report, please."

Sorry ... a little frustrated :-)



I need a WPF window that has a background image and I desire it not to scale beyond a certain point or maybe even at all.  I am trying to duplicate the image effect of this site...  http://richardpwalton.co.uk/ - When you scale the window it only scales down so far and then starts to clip but I don't know how to do that in WPF.

Any suggestions?

yes i am relatively new to WPF :)


hi friends,

      I am struggling on stop page refreshing when the image button is clicked.How i can i achieve this?I used triggers,javascript,........

             Thanks in advance.



I am using sharepoint designer 2007. I move data from 32 bit to 64 bit architecture. some of the hyperlinkslinks are not showing in my website hyperlink list hence site is not working correctly. what should I do? How can I show internal hyperlink?



I have been trying to perform a simple task with sharepoint designer 2010 that keeps breaking one of my list colums (in the custom view that is). 

Background:  I have a list that we are using to assist with Document control in our organization.  The list consists of a few columns: Document number, Title, Owner, Doc Type, and file link (hyperlink to a pdf).  When I create a new out of the box standard view, everything works as desired.  However, I need to adjust the column widths on a couple columns in SharePoint designer, which seems to break the file link column functionality (all of the hyperlinks are now formatted to go to the same document, thought the file paths in each list item are correct).  Funtionality of the file links column works perfectly, until I make a single change to the view in SharePoint designer and save.  Any insight on this issue would be greatly appriciated.



I want a hyperlink field on a task/assignment to link to a InfoPath form.  I want users to be able to click on it in the My Tasks view.

The hyperlink field seems to work fine in the Project Center views but not the My Tasks views?  Anyone know any trick as to how to get it to work? 


when i'm running a test and i want to stop it right after i clicked the run button the test doesn't stop when clicking the stop button.




Hi all,

How do i differentiate the difference between a normal tabstop and a custom tabstop?

I have access to the custom tabstops using the sprmPChgTabsPapx variable.

But i don't know how to apply it, because there could be normal tab stops(0.5 inch) while with

the custom tab stops in the paragraph text run.


Thank you,



In my application i need to convert all types of bit maps images to Monochrome images.

the various convertions i want is

16bit.bitmap - MONOCHROME;




i want this in c#.

please help me any one.

thanx in advance.



<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure