Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP ASP.NET DevExpress
Hi,
 
I have to use repeater control at page. I try to show images by readin image paths. Code block is like :
 
    <table id="repeaterControl" style="margin-removed 300px">
                <tr>
                    <td>
                        <asp:Repeater runat="server" ID="repeater" Visible="True">
                            <ItemTemplate>
                                <dx:ASPxImage  runat="server" ID="ASPxImage2" ImageUrl='<%# String.Format("RepeaterImages/{0}.png", Container.DataItem) %>'
                                    Cursor="pointer"  ClientInstanceName='<%# "widgetButton_" + Container.DataItem %>'
                                    ToolTip='<%# "Show " + Container.DataItem %>' ClientSideEvents-Click='<%# GetClientButtonClickHandler(Container) %>'>
                                </dx:ASPxImage>
                            </ItemTemplate>
                        </asp:Repeater>
                    </td>
                </tr>
          </table>
 
When I build page and try to view page source, there is nothing at page source which repeater should be seen. Page source is seen like below:
 
<table id="repeaterControl" style="margin-left: 300px">
               <tr>
                   <td>
 
                   </td>
               </tr>
 
    </table>
 
I thought that I can not read images and repeater can not be generated. My aspx page and image folder are at the same directory in project. And all images are .png extensioned.
How can I resolve this situation ?
Thanks for the replies in advance..
Posted 22-Feb-13 1:54am
Comments
Sm.Abdullah at 22-Feb-13 8:17am
   
is it essential to use this image tag "dx:ASPxImage "
what if you use simple img Tag ?
try this one..
<img scr="<%# String.Format("RepeaterImages/{0}.png", Container.DataItem) %>"/>
no_-_namee at 22-Feb-13 8:31am
   
Yes, it is essential to use according to the project scenario. Also I tried your suggestion , but it doesn't work. I put repeater control in div tag like:
 
<pre>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server" >
<div>
<asp:Repeater runat="server" ID="repeater" Visible="True">

<img src="<%# String.Format("RepeaterImages/{0}.png", Container.DataItem) %>" />


</div>
</form>
</body>
</html></pre>
 
Page source is seen like again below :
 
<pre><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
 
</title></head>
<body>
<form method="post" action="AppTest.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTg4MDU3NjI2N2RktnyyVekMjaGSMPUftwTz7GK8VGVArGAn36Om/O+A7i4=" />
</div>
 
<div>

</div>
</form>
</body>
</html>
</pre>
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Did You check Your data source has records when you binding to repeater and how you binding.
  Permalink  
Comments
no_-_namee at 22-Feb-13 8:34am
   
There is an image folder which I read them from paths'. I dont bind them , I try to read these images with string.format like seen at question. Should I bind them ? If I should ,how ?
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

For Example: Set your Images in Data table and then Bind this datatable to repeater.
  Permalink  
Comments
no_-_namee at 22-Feb-13 8:50am
   
Actually ,I used a repeater control which reads image from a folder at another project. I looked from older one and control the new page,there is no difference. But it doesn't work. I couldn't understand why repeater is not seen ?
Syed Ali Raza at 22-Feb-13 8:54am
   
I have doubt How you using this
but you can set the Path of Images from a folder to datatable and Bind it to repeater, without binding how u using this?

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



Advertise | Privacy | Mobile
Web03 | 2.8.141015.1 | Last Updated 22 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100