Click here to Skip to main content
15,884,020 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Draw Shape in Canvas Pin
jkirkerx28-Oct-19 12:53
professionaljkirkerx28-Oct-19 12:53 
QuestionHow do i make my detailsviewmodel work Pin
Stefaneus22-Oct-19 6:31
Stefaneus22-Oct-19 6:31 
AnswerRe: How do i make my detailsviewmodel work Pin
jkirkerx23-Oct-19 10:54
professionaljkirkerx23-Oct-19 10:54 
QuestionHow do i make a bootstrap carousel work with Asp.net core Razor Pin
Stefaneus21-Oct-19 14:49
Stefaneus21-Oct-19 14:49 
AnswerRe: How do i make a bootstrap carousel work with Asp.net core Razor Pin
Richard Deeming22-Oct-19 1:00
mveRichard Deeming22-Oct-19 1:00 
Look at the HTML in the documentation[^]:
HTML
<div class="carousel-inner">
    <div class="carousel-item active">
        <img src="..." class="d-block w-100" alt="...">
    </div>
    <div class="carousel-item">
        <img src="..." class="d-block w-100" alt="...">
    </div>
    <div class="carousel-item">
        <img src="..." class="d-block w-100" alt="...">
    </div>
</div>
Now look at the HTML your page is generating:
HTML
<div class="carousel-inner">
    <div class="carousel-item active">
        <img class="img-fluid" src="..." alt="First slide">
        <img class="img-fluid" src="..." alt="First slide">
        <img class="img-fluid" src="..." alt="First slide">
    </div>
</div>
You need to move the carousel-item tag inside your item loop, and move the item loop outside of the indicators loop.

There's also no point checking whether Model.car.Images is null - if it was, your view would have crashed on the indicators loop above.
Razor
<div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
    <ol class="carousel-indicators">
    @for (int i = 0; i < Model.car.Images.Count; i++)
    {
        string cssClass = i == 0 ? "active" : null;
        <li data-target="#carouselExampleIndicators" data-slide-to="@i" class="@cssClass"></li>
    }
    </ol>
    
    <div class="carousel-inner">
    @for (int i = 0; i < Model.car.Images.Count; i++)
    {
        string fileName = Model.car.Images[i].Filename;
        string cssClass = i == 0 ? "carousel-item active" : "carousel-item";
        <div class="@cssClass">
            <img class="img-fluid" src="~/Images/Cars/@fileName" alt="">
        </div>
    }
    </div>

    <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
        <span class="carousel-control-prev-icon"></span>
        <span class="sr-only">Previous</span>
    </a>

    <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
        <span class="carousel-control-next-icon"></span>
        <span class="sr-only">Next</span>
    </a>
</div>




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: How do i make a bootstrap carousel work with Asp.net core Razor Pin
Stefaneus22-Oct-19 5:02
Stefaneus22-Oct-19 5:02 
GeneralRe: How do i make a bootstrap carousel work with Asp.net core Razor Pin
Richard Deeming22-Oct-19 5:14
mveRichard Deeming22-Oct-19 5:14 
GeneralRe: How do i make a bootstrap carousel work with Asp.net core Razor Pin
Stefaneus22-Oct-19 7:04
Stefaneus22-Oct-19 7:04 
Answer[REPOST] How do i make a bootstrap carousel work with Asp.net core Razor Pin
Richard Deeming22-Oct-19 1:03
mveRichard Deeming22-Oct-19 1:03 
QuestionSystem.Data.SqlClient.SqlException: 'The parameterized query '(@Name varchar(7),@Alias varchar(4),@Under_Group varchar(8000),@' expects the parameter '@Under_Group', which was not supplied.' in winforms of database in .net Pin
Member 1462438515-Oct-19 21:29
Member 1462438515-Oct-19 21:29 
AnswerRe: System.Data.SqlClient.SqlException: 'The parameterized query '(@Name varchar(7),@Alias varchar(4),@Under_Group varchar(8000),@' expects the parameter '@Under_Group', which was not supplied.' in winforms of database in .net Pin
Richard MacCutchan15-Oct-19 22:06
mveRichard MacCutchan15-Oct-19 22:06 
AnswerRe: System.Data.SqlClient.SqlException: 'The parameterized query '(@Name varchar(7),@Alias varchar(4),@Under_Group varchar(8000),@' expects the parameter '@Under_Group', which was not supplied.' in winforms of database in .net Pin
ZurdoDev16-Oct-19 8:34
professionalZurdoDev16-Oct-19 8:34 
QuestionMy Visual Studio 2017 community is opening my React-Redux Application with tsx files by default Pin
simpledeveloper9-Oct-19 7:18
simpledeveloper9-Oct-19 7:18 
AnswerRe: My Visual Studio 2017 community is opening my React-Redux Application with tsx files by default Pin
jkirkerx10-Oct-19 9:55
professionaljkirkerx10-Oct-19 9:55 
GeneralRe: My Visual Studio 2017 community is opening my React-Redux Application with tsx files by default Pin
simpledeveloper16-Oct-19 8:07
simpledeveloper16-Oct-19 8:07 
GeneralRe: My Visual Studio 2017 community is opening my React-Redux Application with tsx files by default Pin
jkirkerx16-Oct-19 8:33
professionaljkirkerx16-Oct-19 8:33 
GeneralRe: My Visual Studio 2017 community is opening my React-Redux Application with tsx files by default Pin
simpledeveloper16-Oct-19 10:00
simpledeveloper16-Oct-19 10:00 
AnswerRe: My Visual Studio 2017 community is opening my React-Redux Application with tsx files by default Pin
Sheetal Nalawade15-Oct-19 19:36
Sheetal Nalawade15-Oct-19 19:36 
GeneralRe: My Visual Studio 2017 community is opening my React-Redux Application with tsx files by default Pin
simpledeveloper16-Oct-19 8:09
simpledeveloper16-Oct-19 8:09 
Questioncannot process the message because the content type 'application/soap+xml charset=utf-8 was not the expected type text/xml Pin
Member 134437687-Oct-19 12:17
Member 134437687-Oct-19 12:17 
AnswerRe: cannot process the message because the content type 'application/soap+xml charset=utf-8 was not the expected type text/xml Pin
Afzaal Ahmad Zeeshan7-Oct-19 18:45
professionalAfzaal Ahmad Zeeshan7-Oct-19 18:45 
GeneralRe: cannot process the message because the content type 'application/soap+xml charset=utf-8 was not the expected type text/xml Pin
Member 1344376818-Oct-19 5:14
Member 1344376818-Oct-19 5:14 
QuestionReact iFrame, want to use it - suggest me if i have any better alternate for my below need Pin
simpledeveloper2-Oct-19 8:25
simpledeveloper2-Oct-19 8:25 
AnswerRe: React iFrame, want to use it - suggest me if i have any better alternate for my below need Pin
Nathan Minier7-Oct-19 1:20
professionalNathan Minier7-Oct-19 1:20 
AnswerRe: React iFrame, want to use it - suggest me if i have any better alternate for my below need Pin
dan!sh 7-Oct-19 2:37
professional dan!sh 7-Oct-19 2:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.