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

  • BiGSH0TROB

    BiGSH0TROB

    7 NİSAN 2011
  • BSA

    BSA

    9 NİSAN 2012
  • Stanislav Petrov

    Stanislav Pe

    7 ŞUBAT 2009