C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Repeater with image control


Posted Date: 21 Jul 2008      Total Responses: 1

Posted By: Saravanan.R       Member Level: Silver     Points: 1



Consider we have repeater within this we have to embed a image,if it clicks a new image is to be displayed. how ca we make it?




Responses

Author: Arun Gandhi    21 Jul 2008Member Level: GoldRating:     Points: 6

better u can do that in datalist.

for ex:

<ASP:DataList id="MyDataList" RepeatColumns="1" runat="server" OnItemCommand="resume_down" OnSelectedIndexChanged="MyDataList_SelectedIndexChanged" >

<ItemTemplate>
<tr>
<td valign="top" align=left colspan="2" >
<asp:ImageButton ID="CompanyName" runat="server" ImageUrl='<%# (string) FormatImageUrl((string) Eval("bookimage")) %>' CommandName="Profile" CommandArgument='<%# Eval("bookid") %>' Width="150px"/>
</td>

<td>
<table>
<tr>
<td align="left" valign="top" ><br />
<font face="arial" size="2" color="gray">Book Name : <b>
<%#DataBinder.Eval(Container.DataItem,"booktitle") %>
</b>
</font>
<br />
</td>
</tr>
<tr>
<td align="left" valign="top" ><br />
<font face="arial" size="2" color="gray">Book Author :<b>
<%#DataBinder.Eval(Container.DataItem,"bookauthor") %>
</b>
</font>
<br />
</td>
</tr>
<tr>
<td align="left" valign="top" ><br />
<font face="arial" size="2" color="gray">Book Type   : <b>
<%#DataBinder.Eval(Container.DataItem,"booktype") %>
</b>
</font>
</td>
</tr>

</table>
</td>
</tr>
</ItemTemplate>
</ASP:DataList>


CS coding:

protected string FormatImageUrl(string url)
{
try
{
if (url != null && url.Length > 0)

return ("F:\\Projects\\Sankar\\BookShop\\" + url);

else return null;
}
catch (Exception ex)
{
return null;
}
}




Post Reply
You must Sign In to post a response.
Next : problem in Gridview in asp.net with C#
Previous : Calling Javascript function from ASP.NET control
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use