Şimdi Ara

Asp.net Mvc Slidera resim ekleme

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
2 Misafir - 2 Masaüstü
5 sn
3
Cevap
0
Favori
2.169
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • Selamun aleyküm.Bir ödev projesi için mvc 5 ile haber sitesi yapmaya çalışıyorum.Haber eklemeler vs tamam ancak anasayfa index için slidera haber resmi vs eklerken sorun yaşıyorum.

    Kodlar

    @model List< Haber_Sitesi.Models.Haber> 

    <div class="featured container">
    <div class="row">
    <div class="col-sm-12">
    <!-- Carousel -->
    <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
    <!-- Indicators -->
    <ol class="carousel-indicators">
    <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
    <li data-target="#carousel-example-generic" data-slide-to="1"></li>
    <li data-target="#carousel-example-generic" data-slide-to="2"></li>
    <li data-target="#carousel-example-generic" data-slide-to="3"></li>
    <li data-target="#carousel-example-generic" data-slide-to="4"></li>
    <li data-target="#carousel-example-generic" data-slide-to="5"></li>
    <li data-target="#carousel-example-generic" data-slide-to="6"></li>
    <li data-target="#carousel-example-generic" data-slide-to="7"></li>

    </ol>
    <!-- Wrapper for slides -->
    <div class="carousel-inner">

    @foreach(var item in Model)
    {
    <div class="item active">
    <img src="@item.HaberResim" alt="First slide">
    <!-- Static Header -->
    <div class="header-text hidden-xs">
    <div class="col-md-12 text-center">
    <h2>@item.HaberBaslik </h2>
    <br>
    <h3>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h3>
    <br>
    </div>
    </div><!-- /header-text -->
    </div>
    }

    <div class="item">
    <img src="/images/2.jpg" alt="Second slide">
    <!-- Static Header -->
    <div class="header-text hidden-xs">
    <div class="col-md-12 text-center">
    <h2>Aenean feugiat in ante et blandit. Vestibulum</h2>
    <br>
    <h3>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h3>
    <br>
    </div>
    </div><!-- /header-text -->
    </div>
    <div class="item">
    <img src="/images/3.jpg" alt="Third slide">
    <!-- Static Header -->
    <div class="header-text hidden-xs">
    <div class="col-md-12 text-center">
    <h2>Curabitur tincidunt porta lorem vitae</h2>
    <br>
    <h3>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h3>
    <br>
    </div>
    </div>
    </div>



    <div class="item">
    <img src="/images/3.jpg" alt="Third slide">
    <!-- Static Header -->
    <div class="header-text hidden-xs">
    <div class="col-md-12 text-center">
    <h2>Curabitur tincidunt porta lorem vitae</h2>
    <br>
    <h3>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h3>
    <br>
    </div>
    </div>
    </div>
    <div class="item">
    <img src="/images/3.jpg" alt="Third slide">
    <!-- Static Header -->
    <div class="header-text hidden-xs">
    <div class="col-md-12 text-center">
    <h2>Curabitur tincidunt porta lorem vitae</h2>
    <br>
    <h3>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h3>
    <br>
    </div>
    </div>
    </div>
    <div class="item">
    <img src="/images/3.jpg" alt="Third slide">
    <!-- Static Header -->
    <div class="header-text hidden-xs">
    <div class="col-md-12 text-center">
    <h2>Curabitur tincidunt porta lorem vitae</h2>
    <br>
    <h3>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h3>
    <br>
    </div>
    </div>
    </div>
    <div class="item">
    <img src="/images/3.jpg" alt="Third slide">
    <!-- Static Header -->
    <div class="header-text hidden-xs">
    <div class="col-md-12 text-center">
    <h2>Curabitur tincidunt porta lorem vitae</h2>
    <br>
    <h3>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h3>
    <br>
    </div>
    </div>
    </div>
    <!-- /Yeni eklenen slider -->
    <div class="item">
    <img src="/images/1.jpg" alt="Second slide">
    <!-- Static Header -->
    <div class="header-text hidden-xs">
    <div class="col-md-12 text-center">
    <h2>Curabitur tincidunt porta lorem vitae</h2>
    <br>
    <h3>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</h3>
    <br>
    </div>
    </div><!-- /header-text -->
    </div>

    </div>
    <!-- Controls -->
    <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left"></span>
    </a>
    <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right"></span>
    </a>
    </div><!-- /carousel -->
    </div>

    </div>
    </div>

    <!-- /////////////////////////////////////////Content -->
    <div id="page-content" class="index-page container">
    <div class="row">
    <div id="main-content">
    <!-- background not working -->
    <div class="col-md-12">

    <div class="box">
    <div class="box-header header-youtube">
    <h2>Youtube</h2>
    </div>
    <div class="box-content">
    <div class="row">
    <div class="col-md-5">
    <div class="wrap-vid">
    <div class="zoom-container">
    <div class="zoom-caption">
    <span class="youtube">Youtube</span>
    <a href="single.html">
    <i class="fa fa-play-circle-o fa-5x" style="color: #fff"></i>
    </a>
    <p>İzle</p>
    </div>
    <img src="/images/2.jpg" />
    </div>
    <h3 class="vid-name"><a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=122554183&url=#" data-href="#">Video's Name</a></h3>
    <div class="info">
    <h5>By <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=122554183&url=#" data-href="#">myname</a></h5>
    <span><i class="fa fa-calendar"></i>@DateTime.Now</span>
    <span><i class="fa fa-heart"></i>1,200</span>
    </div>
    </div>
    <p class="more">Aenean feugiat in ante et blandit. Vestibulum posuere molestie risus, ac interdum magna porta non. Pellentesque rutrum fringilla elementum. Curabitur tincidunt porta lorem vitae accumsan.</p>
    </div>

    <div class="col-md-4">
    <div class="post wrap-vid">
    <div class="zoom-container">
    <div class="zoom-caption">
    <span class="vimeo">Youtube</span>
    <a href="single.html">
    <i class="fa fa-play-circle-o fa-3x" style="color: #fff"></i>
    </a>
    <p>İzle</p>
    </div>
    <img src="/images/1.jpg" />
    </div>
    <div class="wrapper">
    <h5 class="vid-name"><a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=122554183&url=#" data-href="#">Video's Name</a></h5>
    <div class="info">
    <h6>By <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=122554183&url=#" data-href="#">myname</a></h6>
    <span><i class="fa fa-heart"></i>1,200 / <i class="fa fa-calendar"></i>@DateTime.Now</span>
    <span class="rating">
    <i class="fa fa-star"></i>
    <i class="fa fa-star"></i>
    <i class="fa fa-star"></i>
    <i class="fa fa-star"></i>
    <i class="fa fa-star-half"></i>
    </span>
    </div>
    </div>
    </div>
    <div class="post wrap-vid">
    <div class="zoom-container">
    <div class="zoom-caption">
    <span class="vimeo">Youtube</span>
    <a href="single.html">
    <i class="fa fa-play-circle-o fa-3x" style="color: #fff"></i>
    </a>
    <p>İzle</p>
    </div>
    <img src="/images/2.jpg" />
    </div>
    <div class="wrapper">
    <h5 class="vid-name"><a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=122554183&url=#" data-href="#">Video's Name</a></h5>
    <div class="info">
    <h6>By <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=122554183&url=#" data-href="#">myname</a></h6>
    <span><i class="fa fa-heart"></i>1,200 / <i class="fa fa-calendar"></i>@DateTime.Now</span>
    <span class="rating">
    <i class="fa fa-star"></i>
    <i class="fa fa-star"></i>
    <i class="fa fa-star"></i>
    <i class="fa fa-star"></i>
    <i class="fa fa-star"></i>
    </span>
    </div>
    </div>
    </div>
    <div class="post wrap-vid">
    <div class="zoom-container">
    <div class="zoom-caption">
    <span class="vimeo">Youtube</span>
    <a href="single.html">
    <i class="fa fa-play-circle-o fa-3x" style="color: #fff"></i>
    </a>
    <p>İzle</p>
    </div>
    <img src="/images/3.jpg" />
    </div>
    <div class="wrapper">
    <h5 class="vid-name"><a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=122554183&url=#" data-href="#">Video's Name</a></h5>
    <div class="info">
    <h6>By <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=122554183&url=#" data-href="#">myname</a></h6>
    <span><i class="fa fa-heart"></i>1,200 / <i class="fa fa-calendar"></i>@DateTime.Now</span>
    <span class="rating">
    <i class="fa fa-star"></i>
    <i class="fa fa-star"></i>
    <i class="fa fa-star"></i>
    <i class="fa fa-star"></i>
    <i class="fa fa-star-half"></i>
    </span>
    </div>
    </div>
    </div>
    <div class="post wrap-vid">
    <div class="zoom-container">
    <div class="zoom-caption">
    <span class="youtube">Youtube</span>
    <a href="https://www.youtube.com/watch?v=4JYB6ylQSTo" target="_blank">
    <i class=" fa fa-play-circle-o fa-3x" style="color: #fff">
    </i>
    </a>
    <p>İzle</p>
    </div>
    <img src="~/images/1.jpg" />
    </div>
    <div class="wrapper">
    <h5 class="vid-name"><a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=122554183&url=#" data-href="#">Dünya'nın dönüşü</a></h5>
    <div class="info">
    <h6>By <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=122554183&url=#" data-href="#">myname</a></h6>
    <span><i class="fa fa-heart"></i>1,200 / <i class="fa fa-calendar"></i>@DateTime.Now</span>
    <span class="rating">
    <i class="fa fa-star"></i>
    <i class="fa fa-star"></i>
    <i class="fa fa-star"></i>
    <i class="fa fa-star"></i>
    <i class="fa fa-star-half"></i>
    </span>
    </div>
    </div>
    </div>
    </div>
    <div class="col-md-3">
    <!-- BAŞLA: TRT Haber Sitene Ekle -->
    <div style="font: normal 11px Arial; width: 280px; border: solid 1px #ccc; background: #fff; border-radius: 32x; box-shadow: 1px 1px 3px #ccc;">
    <h2 style="padding: 8px; margin: 0; height: 45px; border: 0; border-bottom: solid 1px #ccc;">
    <a href="http://www.trthaber.com/">
    <img src="http://s2.trthaber.com/static/images/siteneEkle/logo_a_v2.png" alt="TRT Haber Haberler" style="border: none 0;">
    </a>
    </h2>
    <iframe frameborder="0" width="288" height="282" src="http://www.trthaber.com/sitene-ekle/mansetler-m/?haberSay=10&renk=a&baslik=1&resimler=1"></iframe>
    <div style="text-align: center;line-height: 23px;border-top: solid 1px #ccc; color: #666; margin-top: 5px;box-shadow: 0 -1px 3px #ccc;">
    <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=122554183&url=http://www.trthaber.com/" data-href="http://www.trthaber.com/">Güncel Haberler</a>  |  <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=122554183&url=http://www.trthaber.com/tum-mansetler.html" data-href="http://www.trthaber.com/tum-mansetler.html">Haber Manşetleri</a>
    </div>
    </div>
    <!-- BİTİŞ: TRT Haber Sitene Ekle -->

    </div>
    </div>
    </div>

    <div class="box">
    <div class="box-header header-natural">
    <h2>Natural</h2>
    </div>
    <div class="box-content">
    <div class="row">
    <div class="col-md-3">
    <div class="box">
    <iframe src="http://in.sitekodlari.com/nv.php" scrolling="no" frameborder="0" width="170" height="280"></iframe> </div>
    </div>
    <div class="col-md-3">
    <div class="box" style="background-color: #FFFFFF; width: 170px;"><iframe scrolling="no" height="290" frameborder="0" name="doviz" src="http://www.e-yasamrehberi.com/gadget/dovizKuru/merkez_bankasi_doviz_kurlari.aspx"></iframe></div>

    </div>
    </div>
    </div>
    </div>
    </div>
    </div>

    </div>

    </div>




    foreach ile yeni slayta yeni bir haber resmi ve başlık ekleyip sonrada o resme tıklanınca ilgili haber kategorisine yönlendirmek istiyorum ancak haber resimleri alt alta sıralanıyor ve düzensiz bir görünüm oluyor.Bu konuda yardım edebilirseniz veyahut yol gösterebilirseniz çok sevinirim.Herkese hayırlı günler.







  • cssi yoktur. veya pathı yanlıştır
  • Kaygerya kullanıcısına yanıt
    Hocam css sorun yokmuş.Sorun foreach döngüsünde değişiklik yapılarak çözüldü.


     <div class="carousel-inner"> 

    @{
    bool first = true;
    }

    @foreach(var item in Model)
    {

    if (first)
    {
    first=false;
    <div class="active item">
    <a href="@Url.Action("HaberPage", "Home", new { dil = "tr", guvenliurl = item.HaberUrl })" target="_blank">
    <img src="@item.HaberResim">
    <p>
    <div class="header-text hidden-xs">
    <div class="col-md-12">
    <h3 style="text-align:left">@item.HaberBaslik</h3>
    </div>
    </div>
    </p>

    </a>
    </div>
    }
    else
    {

    <div class="item">
    <a href="@Url.Action("HaberPage", "Home", new { dil = "tr", guvenliurl = item.HaberUrl })" target="_blank">
    <img src="@item.HaberResim">
    <div class="header-text hidden-xs">
    <div class="col-md-12 text-nowrap">
    <h3 >@item.HaberBaslik</h3>
    <br>
    </div>
    </div>
    </a>
    </div>
    }

    }

    </div>




  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.