Results 1 to 5 of 5

Thread: How to change id values on a control while looping through.

  1. #1

    Thread Starter
    Member Comn8u's Avatar
    Join Date
    Jul 2004
    Posts
    35

    How to change id values on a control while looping through.

    I'm trying to add a hot news section with the TOP 3 results from the database into rounded edged tables. What I want to do is change the id value so it is not the same for each one. What I tried to do is add an incremented integer value at the end of "RoundedCorners1" with n being the incremented integer value and the tags looked like this:

    <% Response.Write("id=RoundedCorners1" & n) %>

    The problem is, I get an error saying that I cannot do this within a control. How would I go about changing the id value each time I loop through?


    Here's the code
    <skm:roundedcorners id="RoundedCorners1" runat="server" BackgroundBackColor="white"
    BackColor="#FFE0C0" BorderColor="Black" BorderStyle="Solid"
    BorderWidth="2px" Font-Names="Verdana"
    ImageDirectory="/Images/" Font-Size="12px"
    Width="150px" Padding="1px" CornerHeight="16px" TextHorizontalAlign="Center">

    This is a simple example with text in the rounded corners box. It has a width
    explicitly set to 150 pixels, and the images are anti-aliased.

    </skm:roundedcorners>
    It's not the size of the dog in the fight, it's the size of the fight in the dog.

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    First, I question why you need to change the ID of a table?

    Second, you can use the Table class within an overrided render method to create a table and assign an id...

  3. #3

    Thread Starter
    Member Comn8u's Avatar
    Join Date
    Jul 2004
    Posts
    35
    The results that I am getting show 3 results on the page. When the data is pulled from the database, it is stored in round tables instead of regular tables. It would be easy to generate with tables but I'm trying to do it with the roundedcorners control.

    The results show the first results within the roundedcorners table, but the next two only print out the data and not the roundedcorners controls. In order for me to place the data within 3 roundedcorners controls, they need to have different id types, but I don't know how to do it because it generates an error. I might be looking for into it than I have to.

    I'm not sure how you would do your idea, can you give me an example?
    It's not the size of the dog in the fight, it's the size of the fight in the dog.

  4. #4
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    A roundedcorners control? Is this a 3rd-party control not included with Visual Studio? I have never heard of it before...

  5. #5

    Thread Starter
    Member Comn8u's Avatar
    Join Date
    Jul 2004
    Posts
    35
    Yeah, it is. It's a GDI+ from 4guysfromrolla that I downloaded. All it does is give you rounded corners instead of the square corners in a table.

    Here is an example of it on this website:
    http://scottonwriting.net/demos/RoundedCorners.aspx

    I've heard from someone else that I could use a <div> tag with CSS to repeat each roundedcorners control.
    It's not the size of the dog in the fight, it's the size of the fight in the dog.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width