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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:36:42+00:00 2026-05-24T10:36:42+00:00

I am using the following: <img src=../../Content/Images/lock_16.gif /> @Html.ActionLink(Register, Register, Users, null, new {

  • 0

I am using the following:

<img src="../../Content/Images/lock_16.gif" />
@Html.ActionLink("Register", 
   "Register", 
   "Users", 
   null, 
   new { title = "Register your ID", rel = "nofollow" 
})

What I would like is for the lock image to appear inside of the <a> </a> so it is clickable and not before it. I already use (and change color on hover) of a background image so its not possible for me to use the background-image property to display the image.

Can anyone think of a way that I can set the image so that it will show before the text and still be clickable. Hopefully I can find a way that still allows me to use the MVC Html.ActionLink.

  • 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-24T10:36:44+00:00Added an answer on May 24, 2026 at 10:36 am

    Html helpers in ASP.NET MVC should be used when they simplify writing code, not always. Plain html would go way better in your case

    <a href="@Url.Action("Register", "Users")" title="Register Your ID", rel="nofollow">
         Register <img src="@Url.Content("~/Content/Images/lock_16.gif")" />
    </a>
    

    Note that link address is still generated dynamically, using UrlHelper.Action method. This way, you do not lose link dependency to your route configuration. Also, as Nicholas mentioned, image source should be generated via Url.Content helper.

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

Sidebar

Related Questions

I have the following links: <a href=http://example.com/src/abc.png><img src=http://example.com/res/bca.png></a> <a href=http://example.com/src/hvc.gif><img src=http://example.com/res/ncq.jpg></a> Using PHP, I
I'm using the following code to scan a folder for images: <?php $dir =
I am using an embedded typeface using the following code: @font-face {font-family: 'PFDinTextPro-Regular';src: url('../webfonts/15B214_0.eot');src:
I have been using the following preload script to load all the images and
I am using the following code public class Img extends Activity { /** Called
The following code sample am using, Images are not displyed in any of IE
I'm changing the img src on click using javascript. I'm trying to determine whether
I am using the following to find all of the images on a given
i am changing the source of an image using the following code: var src
I'm using the following to load a placeholder for missing images: $(document).ready(function() { $('.p-box

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.