Click here to Skip to main content
16,021,125 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have 10 records and
My first record when I click on the picture of a field of a field picture shown
But if a record 10 shots in a field in the same column I click on the image first record will be displayed again.
In general I click on any field in the same column of the first record images displayed. Why?

C#
<td class="text-center ">
                    @*data-target=".bs-example-modal-lg"*@
                        <img data-toggle="modal" data-target="#myModal" style="width:30px ;height:30px;" alt="@item.ProductName" src="@Url.Content(@item.ProductImage)" />
                    <div class="modal fade bs-example-modal-lg"  id="myModal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
                        <div class="modal-dialog modal-lg">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true"</span><span class="sr-only">Close</span></button>
                                </div>
                                <div class="modal-title">
                                    <h4 style="color: green">@item.ProductName </h4>
                                    <br />
                                    <p>برنامه های خود را از ما بخواهید  -  کدنویس دات کام</p>

                                </div>
                                <div class="modal-body">
                                    <img  style="width:150px ;height:150px;" src="@Url.Content(item.ProductImage)" />
                                       
                                </div>

                                <div class="modal-footer">
                                    <button type="button" class="btn btn-danger" data-dismiss="modal">برگشت </button>
                                </div>
                            </div>
                        </div>
                    </div>
Posted
Comments
Sinisa Hajnal 7-Oct-14 2:18am    
Are you sure your model contains different images? Maybe the problem is at the retreival of data?
Also, aren't you missing @ in item.ProductImage in modal-body? Not expert in razor syntax, but all other item accessors have it.

These are three images from the list.
If you look at my first record the image the image the color purple, but when I click on my picture 3 Picture # 1 will be displayed. I'm so upset :(

آپلود عکس | آپلود | سایت آپلود عکس | اپلود عکس
 
Share this answer
 
Comments
Sinisa Hajnal 7-Oct-14 7:29am    
You know there is improve question link. You shouldn't post solutions that are really questions because people will see this as answered and ignore it.

Use developer tools in the browser, right-click on the image and check the src parameter. Then open console and click on the image, see if there is an error. Then go to your image opening code and add console.log (something); behind each critical row where something is current URL, object or simply marker: console.log("Opening image...");
...
console.log(imageURL);
...
console.log(modalDlg); etc
SQL
My friend. My problem is that I took pictures of the database are read. And I have no information from the pictures I took, and now I want to run them by clicking Show me. The same
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900