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

  • kruno j

    kruno j

    6 Mayıs 2007
  • OVERWERK

    OVERWERK

    6 Temmuz 2010
  • thelonelyisland

    thelonelyisl

    23 Aralık 2005