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

4 posts, 0 answers
  1. Tzach Kaufmann
    Tzach Kaufmann avatar
    95 posts
    Member since:
    Aug 2008

    Posted 21 Feb 2012 Link to this post

    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!

     

  2. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 23 Feb 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Antoine
    Antoine avatar
    4 posts
    Member since:
    Apr 2012

    Posted 23 Aug 2012 Link to this post

    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
  5. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 27 Aug 2012 Link to this post

    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.
Back to Top