MVC - Can a partial view replace itself
I have a strong typed partial view of a class that contains a list of image urls and the index of the current image. Now I need a 开发者_StackOverflow社区"next" button that reloads my partial view with the updated index. The point is that I don't want to save this list or index with javascript. The partial view will render the image as follows:
<img id="imgMain" src="<%: Url.Content(Model.GetCurrentImageUri().RelativeUri.ToString()) %>" alt="" />
Thank you very much for your help!
The solution is to store the index of my array in a hidden field. Then I fetch the data with a ajax call and replace my partial view with the resulting data. That is all, very easy :)
精彩评论