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

  • Bucky Roberts

    Bucky Robert

    9 HAZİRAN 2011
  • Fraser Raft

    Fraser Raft

    9 Mart 2010
  • Lena Danya

    Lena Danya

    11 NİSAN 2010