SORU
27 ŞUBAT 2009, Cuma


Html.Bir düğme olarak ActionLink veya bir resim, bir link

ASP.NET MVC (RC1) son sürüm, Html nasıl alabilirim.Bir düğme veya bağlantı yerine bir görüntü olarak işlemek için ActionLink?

CEVAP
20 Mart 2009, Cuma


Yanıt geç ama sadece basit tutmak ve htmlAttributes nesne için bir CSS sınıfı uygular.

<%= Html.ActionLink("Button Name", "Index", null, new { @class="classname" }) %>

ve sonra stil bir sınıf oluşturun

a.classname
{
    background: url(../Images/image.gif) no-repeat top left;
     display: block;
     width: 150px;
     height: 150px;
     text-indent: -9999px; /* hides the link text */
}

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Breno Rises

    Breno Rises

    7 Ocak 2014
  • Commander Chalkboard

    Commander Ch

    20 Ocak 2014
  • gamingbits

    gamingbits

    2 Mayıs 2006