locked
Image Not Found On ahref RRS feed

  • Question

  • User-807418713 posted

    Hello

    This is my aspx code

      <div class="row">
                <div class="col-12">
                    <div class="mx-auto tm-gallery-container">
                        <div class="grid tm-gallery">
                        
                        <asp:Repeater ID="Rept" runat="server">
                         <ItemTemplate>
                      
                        
                         <a href='<%#Eval("ImageName", "~/SlideImages/{0}") %>'>
                            <figure class="effect-honey tm-gallery-item">
                             
                              <img src='<%#Eval("ImageName", "~/SlideImages/{0}") %>' class="img-fluid" />
    
                              <figcaption>
                                <h2><i>Fifth <span>Honey</span> Now</i></h2>
                              </figcaption>
                            </figure>
                          </a>
                          </ItemTemplate>
                          </asp:Repeater>
                     
                      
                        </div>
                    </div>                
                </div>        
              </div>

    On load it showing image not found let me know where im wrong?

    what to change in my code

    Wednesday, February 19, 2020 12:33 PM

Answers

  • User1535942433 posted

    Hi Gopi.MCA,

    Accroding to your codes,I suggest you could change the ~ to ..

    More details,you could refer to below codes:

    <div>
                  <div class="row">
                <div class="col-12">
                    <div class="mx-auto tm-gallery-container">
                        <div class="grid tm-gallery">
                        
                        <asp:Repeater ID="Rept" runat="server">
                         <ItemTemplate>
                      
                        
                         <a href='<%#Eval("ImageName", "../images/{0}") %>'>
                            <figure class="effect-honey tm-gallery-item">
                             
                              <img src='<%#Eval("ImageName", "../images/{0}")%>' class="img-fluid" />
    
     
    
                              <figcaption>
                                <h2><i>Fifth <span>Honey</span> Now</i></h2>
                              </figcaption>
                            </figure>
                          </a>
                          </ItemTemplate>
                          </asp:Repeater>
                     
                      
                        </div>
                    </div>                
                </div>        
              </div>
            </div>

    Result:

    Best regards,

    Yijing Sun

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 20, 2020 8:11 AM

All replies

  • User475983607 posted

    On load it showing image not found let me know where im wrong?

    Gopi.MVC, come on dude.   You've been on these forums long enough to debug your code!  If you open dev tools and take a look at the HTML source you'll see the href has a "~".

    Use a server control!

    Wednesday, February 19, 2020 12:47 PM
  • User1535942433 posted

    Hi Gopi.MCA,

    Accroding to your codes,I suggest you could change the ~ to ..

    More details,you could refer to below codes:

    <div>
                  <div class="row">
                <div class="col-12">
                    <div class="mx-auto tm-gallery-container">
                        <div class="grid tm-gallery">
                        
                        <asp:Repeater ID="Rept" runat="server">
                         <ItemTemplate>
                      
                        
                         <a href='<%#Eval("ImageName", "../images/{0}") %>'>
                            <figure class="effect-honey tm-gallery-item">
                             
                              <img src='<%#Eval("ImageName", "../images/{0}")%>' class="img-fluid" />
    
     
    
                              <figcaption>
                                <h2><i>Fifth <span>Honey</span> Now</i></h2>
                              </figcaption>
                            </figure>
                          </a>
                          </ItemTemplate>
                          </asp:Repeater>
                     
                      
                        </div>
                    </div>                
                </div>        
              </div>
            </div>

    Result:

    Best regards,

    Yijing Sun

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 20, 2020 8:11 AM