DataBinding in CSS

Discussion in 'C#' started by Aliniuz2, Apr 8, 2009.

  1. #1
    Hello.

    Let's say I have a menu bar.



    <ul>
    <li>Link 1</li>
    <li>Link 2</li>
    <li>Link 3</li>
    ...
    <li>Link n</li>
    </ul>

    Those links i extract them from a database, and are databinded in an asp.net page.

    My ul has a fixed width in css (960px). I want that the li width to be (960/n). I made a method that calculates the LiWidth and it databindes it in my asp.net page. But I can't use it in CSS. :(

    <li style="width: <%# LiWidth %>">Link</li> It doesn't work. What shall I do? Thank you in advance.
     
    Aliniuz2, Apr 8, 2009 IP
  2. dgxshiny

    dgxshiny Greenhorn

    Messages:
    65
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    23
    #2
    Try <li style="width: <%= LiWidth %>px">Link</li>
     
    dgxshiny, Apr 9, 2009 IP