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

  • booba1234

    booba1234

    22 Temmuz 2006
  • NCIX Tech Tips

    NCIX Tech Ti

    2 Ocak 2007
  • The Dubstep FX

    The Dubstep

    5 Mart 2011