473,772 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to change image in repeater header

29 New Member
Hi All
i have a repeater control in that i have to coulmns i need to sorts those columns i am able to sort but according to sorting asscending or descending
i need to change the image in the header How to go for it ?
Oct 16 '07 #1
4 2863
Frinavale
9,735 Recognized Expert Moderator Expert
Hi All
i have a repeater control in that i have to coulmns i need to sorts those columns i am able to sort but according to sorting asscending or descending
i need to change the image in the header How to go for it ?

What have you tried so far?

-Frinny
Oct 16 '07 #2
Sandeep akhare
29 New Member
What have you tried so far?

-Frinny
I am unable to get access to the header controls below is my header control
Expand|Select|Wrap|Line Numbers
  1. <asp:Repeater ID="Repeater1" runat="server" >
  2.                 <HeaderTemplate >
  3.                     <table cellspacing="0" cellpadding="0" border="0" style="width: 100%; border-collapse: collapse;">
  4.                         <tr>
  5.                             <td class="tanrow" align="Left">
  6.                                 <asp:LinkButton id="lnkPartID" OnClick="SortCommand" OnClientClick="hideId();"  runat="server" CommandArgument="ID">ID</asp:LinkButton>
  7.                                <asp:Image ID="ImageID" runat="server" ImageUrl="~/Images/IconArrowDown.gif" />
  8.                             </td>
  9.                             <td align="Left">
  10.                                 <asp:LinkButton id="lnkPartName"  runat="server" OnClick="SortCommand" CommandArgument="Name">Name</asp:LinkButton>
  11.  
  12.                                 <asp:Image ID="ImageName" runat="server"  ImageUrl="~/Images/IconArrowUp.gif"/>
  13.                         </tr>
  14.                 </HeaderTemplate>
  15.                 <ItemTemplate>
  16.                     <tr id="DataRow" runat="server">
  17.                         <td align="Left" >
  18.                             <%# (DataBinder.Eval(Container.DataItem, "ID"))%>
  19.                         </td>
  20.                         <td align="Left" >
  21.                             <%# (DataBinder.Eval(Container.DataItem, "Name"))%>
  22.                         </td>
  23.                     </tr>
  24.                 </ItemTemplate>
  25.  
  26.                 <FooterTemplate>
  27.                     </table>
  28.                 </FooterTemplate>
  29.             </asp:Repeater>
Oct 17 '07 #3
AxleWacl
3 New Member
Where you use your databinder.eval ...... Try something in the line of the code below:(This is for vs.net 2003, not sure if it will work for 2005,but should)

Expand|Select|Wrap|Line Numbers
  1. <td><a href='story.aspx?s=<%# DataBinder.Eval(Container.DataItem, "makeid") %>' ><img border=0 src='assets/images/<%# DataBinder.Eval(Container.DataItem, "make") %>.jpg' height=55 width=65/></a>
Basicall what is happening, the...
Expand|Select|Wrap|Line Numbers
  1. <td><a href='story.aspx?s=<%# DataBinder.Eval(Container.DataItem, "makeid") %>
...is reading the "headline" name from the Database, which displays is by the MAKEID and forwards you to the Story.aspx page with the MAKEID, the...
Expand|Select|Wrap|Line Numbers
  1. <img border=0 src='assets/images/<%# DataBinder.Eval(Container.DataItem, "make") %>.jpg' height=55 width=65/>
... Displays the IMAGE stored in my assets/images folder, which is found by the Make. So you have the image now next to the corresponding headline.....

Hope this helps
Oct 17 '07 #4
Frinavale
9,735 Recognized Expert Moderator Expert
Thanks for your help AxleWacl!

Could you both please use [ code] tags when posting code.
An example of posting C# code:
[ code=cpp]
//My C# code here
[ /code]

An example of posting VB.NET code:
[ code=vbnet]
'My Vb.NET code here
[ /code]

Thank you!
-Moderator
Oct 17 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
3778
by: seeni | last post by:
I have tried retrieving the image data from NorthWind database and print in the asp page using Repeater control. But instead of showing picture, the browser is showing "System.Byte" My code is In codebehind file. private void Page_Load(object sender, System.EventArgs e) {
0
1123
by: Robert Walter | last post by:
I was looking for a method to repeat the headers on an ASP.NET Repeater control. I couldn't find quite what I wanted on the web so I implemented it myself. I thought it maybe useful for some of you out there (code is below). It works exactly the same as a normal repeater except that there is an extra property HeaderRepeatRows in it. Note, if you use this generate a table then put the <table> tag outside the header template otherwise...
1
2396
by: Matthew Law | last post by:
Hi, I have a repeater in my vb.net page which needs to render an image control (it's a mappoint linedrive map image). The repeater itself is bound to an array of object 'Directions' which contains mostly strings, but one of the Properties of the Direction Class is an image of type System.Web.UI.WebControls.Image. Obviously, if I try to render it in the repeater with the same technique used for a string:
4
9563
by: nicholas | last post by:
Got an asp.net data-repeater on my page. I can view the texts from the database (ex.: <%# Databinder.Eval(Container.DataItem, "contentEN") %> ), but I also would like to see the image, but only if there is one. So in the repeater there should be someting like: if ( the_image_field <> "" ) then show the image with the filename from the database field end if
8
4150
by: Matthew Curiale | last post by:
I am creating an app that lists clients of a company for management of different attributes for that company. The first page is a listing of the companies currently in the database. I have my repeater working, and paging/sorting works, but there is a small bug that I can't seem to figure out. If, for example, I display 5 records per page, the paging function executes fine, and only shows 5 records per page. This is no problem. When I...
3
4168
by: Shimon Sim | last post by:
I put linkbutton in a repeater header. I attached event handler in makeup as onclick="btnSort_Click". Made btnSort_Click method public. It doesn't fire if I click on it. I tried to attach it in ItemDataBound event but I think it is too late. What am I doing wrong? Thanks Shimon.
2
2436
by: Andy | last post by:
Hi, This is one of those things I thought should e easy... I'm programatically trying to set the navigateURL property in a hyperlink in the headertemplate of a repeater, but always get the following error "Object reference not set to an instance of an object." when referencing the hypermink in the following line.. hypAuthors.NavigateUrl = "http://www.microsoft.com"
0
1714
by: Iain | last post by:
Hi I am using Borland Developer 2006, C# web application. Fairly new to the .net platform and very new to repeaters. I have 2 repeaters on a page, both of which are filled from a database. The Links in the left hand column are created correctly and displayed. The images/Links (hrefs) in the right hand column are the problem. The links are displayed correctly but the images are not displayed. The html is build dynamically. I have...
3
3965
by: Emma Middlebrook | last post by:
Hi there, I've been trying to implement a repeater control in an ASP.NET 2 page but I can't seem to get the layout exactly how I want and I'm not sure if it's something that I am doing wrong or maybe the repeater control doesn't have the capabilities...? The page needs to display a custom number of sections that appear the same but have different data..
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6713
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.