How to eliminate the underline on a link button?

Within my webform, I've defined a LinkButton as follows:

<asp:LinkButton Visible="True" style="text-decoration:none;color:blue;" Font-Underline="false" runat="server" ID="lnkEditCarOrderNumber" 
    CommandName="EditCarDetails"><%#((int)Eval("CarStatusId")!=1 && (Eval("CarOrderNumber")=="" || Eval("CarOrderNumber")==DBNull.Value)) 
    ? "(click to add)" 
    Eval("CarOrderNumber")%>
</asp:LinkButton>

The content of the link is dynamically generated using a C# ternary expression.

Despite attempting to remove the underline in both the style and Font-Underline properties, the link always displays an underline. Any suggestions on why this might be happening?

I'm aware that utilizing CSS could potentially resolve this issue, but I believe inline styling should also work. Any insights or assistance would be greatly appreciated.

Answer №2

One suggested update:

We could eliminate the line
Font-Underline="false"

and instead employ

CssClass="nounderlineline" //you can customize your own css class or make a new one.

I have implemented this on my websites, especially in cases involving LinkButtons. It should be effective for you as well.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using Azure Key Vault Secrets to Configure Services in a Blazor Application

I'm currently facing a challenge with passing an Azure KeyVault Secret to my Database Settings configuration. Here is the code snippet in question: Program.cs var keyVaultEndPoint = new Uri(builder.Configuration["VaultKey"]); var secretClie ...

What prompts certain individuals to convert their asp.net pages into HTML pages before publishing?

Recently, I was informed that there is a possibility of working on a project involving ASP.NET 3.5 and C#. A colleague suggested that when we publish the site, we should convert all pages to HTML. This means instead of www.test.com/Page.aspx, it would be w ...

Shift the Search bar to the last position on the navigation bar

I'm looking to relocate the search icon and input field to the end of the navbar. I'm currently using Bootstrap 5.0.2, but I am still new to Bootstrap, HTML, and CSS, so I'm not sure how to accomplish this. I want the width of the search box ...

media query for css on windows 7 mobile devices

Is there a way to apply CSS media queries specifically for Windows phone 7? I have attempted the following code without success: @media only screen and (max-width: 480px) and (min-width: 5px) { // css here } Any advice or guidance would be greatly appr ...

Integrate JavaScript with WordPress

How can I get this functioning properly within Wordpress? I have been attempting to connect everything together, but it doesn't appear to be working. Is this the correct way to do it, or am I overlooking something? <script type="text/javascript" s ...

What steps should I follow to create a cohesive background design using CSS?

https://i.sstatic.net/e3LYL.png Is there a way to combine two separate div elements in CSS? Currently, the image Row and col are not connected to the above SVG blob. How can I utilize the blob as a background? Based on the code provided below, they appear ...

Error: The connection to MongoDB in Unity3D is failing due to an invalid keyword 'mongodb+srv://test:test@HOST'

I'm currently facing an issue when trying to connect my live MongoDB database locally. The problem arises when I use an external string instead of the usual localhost. My setup includes: MongoDB database v4.0.x (using FREE Cluster of mongoDB) Unity 2 ...

Combining ng-repeat with the float property set to left

I am attempting to create two rows of divs using ng-repeat. Each div is styled with a float: left attribute, and at the end, I add a clearing div with clear: both. <div class="interval" ng-repeat="interval in intervals"> <div class="text-cen ...

What is the best way to align the form labels alongside and right justified with the form elements?

Could someone please help me with aligning my labels to be inline and right-justified against form elements? Currently, I'm facing this issue: this section { display: flex; flex-direction: row; justify-content: center; width: 960px; ...

My mobile is the only device experiencing responsiveness issues

One challenge I'm facing is with the responsiveness of my React application, specifically on my Galaxy J7 Pro phone which has a resolution of 510 pixels wide. Interestingly, the app works perfectly on a browser at this width, as well as on my tablet ...

Steps for designing an HTML table that expands and collapses partially

I am currently revamping an old "Top Screens" page by expanding the display from the top 30 to the top 100 in a basic html table format. However, I only want to show the top 20 on page load with an expand/collapse feature. While I have come across examples ...

Achieve a seamless look by ensuring shadows are positioned behind every element

Need help with creating dynamic shadows on divs. Here is what I have so far: HTML <div id="wrapper"> <div id="div1" class="castsshadow">Div 1</div> <div id="div2" class="castsshadow">Div 2</div> <div id="div3" ...

Adjust the color of a row in a table based on the value of a cell (negative/positive) stored in

I have created a table displaying historical transactions. Within my transaction database, there is a column called QuantityChange which can hold negative or positive values. My goal is to visually distinguish the rows based on the value of QuantityChange ...

Utilize jQuery to create a login form within a div when triggered by clicking on

I have implemented a jQuery script for login functionality that displays a new div in the center of the page while fading out the rest of the content. It is functioning correctly when I use an anchor tag with the class='login-window' and select i ...

Filtering database records using a static dropdown list in MVC 5: A step-by-step guide

Is there a way to filter database records based on the columns QtyRecieved, QtyRecievedand Void using a static HTML dropdown list? The QtyRecieved and QtyRecievedand column are both decimal values, while Void is a boolean. This is what I have attempted: ...

Nav background image will have a height that covers 100% of the page

I'm having trouble getting the navigation background image to match the height of my page, and I've tried various methods suggested on this platform with no success. As a beginner in HTML5 and CSS, please excuse me if this is a basic question. Th ...

C# Ajax Insert not inserting data in the expected sequence

Hello, I am facing an issue with the following AJAX method. When trying to insert data for Monday, Tuesday, and Wednesday, the days are inserted in a non-orderly manner. Sometimes Monday is inserted first, while other times Thursday is inserted first. I ha ...

Is there a way for me to scroll and bring the block up to the header when the button is clicked?

My goal is to create a functionality where clicking on the button with the class .booking__button will smoothly scroll the block up under the header. The position of the block should remain consistent, only the scrolling effect should be visible to the use ...

How can I use Jquery to slide one div over another and replace it in its position?

I am working on creating a unique animation using CSS and jQuery. The animation involves a green box sliding (or growing) over a fixed red box, and then toggling back so that the green box shrinks while the red one reappears. One issue I encountered was u ...

Showing the Datepicker upon clicking the button

I am trying to implement a datepicker that shows up when a button is clicked. Unfortunately, my attempts have been unsuccessful so far. I am working with Materialize Css and have experimented with using an input type of text, but it's not quite what I ...