html5 - Razor object in a href tag -
i new on area of mvc 4 , razor. trying build gallarary "css3 lightbox". looks ok problem cant work razor , links. cant understand wrong links of pre , next url. hope can help, thins maybe wrong. code looks that:
@for (var = 1; < viewbag.gallaryitems.length; i++) { <li> <a href="#image-@i"> <img src="@viewbag.gallaryitems[i].path" /> <!-- <img src"~/images/gallary/pic1.jpg" alt="image01"/> --> <span>pointe</span> </a> <div class="lb-overlay" id="image-@i"> <img src="@url.content(viewbag.gallaryitems[i].path)" /> <div> <h3>@viewbag.gallaryitems[i].title<span>/point/</span></h3> <p>@viewbag.gallaryitems[i].description</p> <a href="#image-@i--" class="lb-prev">prev</a> <a href="#image-@i++" class="lb-next">next</a> </div> <a href="#page" class="lb-close">x close</a> </div> </li> }
simple didn href="#image-@(i-1) on prev , href="#image-@(i+1) on next , works fine now!
Comments
Post a Comment