This is a migrated thread and some comments may be shown as answers.

Image that was added on server side, is not displayed in the rad rotator

3 Answers 51 Views
Rotator
This is a migrated thread and some comments may be shown as answers.
Covertix
Top achievements
Rank 1
Covertix asked on 21 Feb 2012, 05:09 PM
Hi,

I add an item to the RadRotator in the server-side, but I can't see it...

here is my code:

System.Web.UI.WebControls.

Image image = new System.Web.UI.WebControls.Image();

 

a.ImageUrl =

"~/Images/Design/Edit.png";

 

RadRotator1.Items.Add(

new Telerik.Web.UI.RadRotatorItem(image));

(The url is correct, I use it a lot in my web site, and I can see that the rad rotator has the item, using f12 when I run the code in my browser)

Do you have any ideas how to solve this problem?

Thanks!

 

3 Answers, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 23 Feb 2012, 01:20 PM
Hi Tzach,

Please use the approach, shown in the following example, in order to add items in the RadRotator control dynamically:
Image image = new System.Web.UI.WebControls.Image();
image.ImageUrl = "~/Images/rome.jpg";
RadRotatorItem item = new RadRotatorItem();
item.Controls.Add(image);
RadRotator1.Items.Add(item);

All the best,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Antoine
Top achievements
Rank 1
answered on 23 Aug 2012, 08:12 AM
Hello,

 I have a button on my page, TexBox that will contain the name of a person and a vacuum rotator at the beginning, how can we add items (image) in my rotator by clicking on the button, I have been the following code in the button's onclick:

  protected void btn_Click (object sender, EventArgs e)
     {
System.Web.UI.WebControls.Image Image image = new ();
image.ImageUrl = "~ / Images / Customers /" + + TextBoxmember.Text. "jpg"};
RadRotatorItem item = new RadRotatorItem ();
item.Controls.Add (image);
RadRotator1.Items.Add (item);
}
c the problem is that it always loads the last person on entry and not save the old values.

thank you
0
Slav
Telerik team
answered on 27 Aug 2012, 12:47 PM
Hello Antoine,

My suggestion is to add the items in a collection that will be used as a data source for the RadRotator and to rebind the control after every included item. Utilizing the client-side API of the rotator is also an option for achieving the desired functionality, as shown in this online demo.

I noticed that you have opened another forum thread for the same problem. Please create a separate forum thread/ticket for every problem you want to report. This way the information on the case will be easier to follow. Let us continue our discussion in your other thread.

All the best,
Slav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Rotator
Asked by
Covertix
Top achievements
Rank 1
Answers by
Slav
Telerik team
Antoine
Top achievements
Rank 1
Share this question
or