Rachel Radford wrote:
I'm working with a page that has auto-generated html from a .net engine that
I then style up with css.  In this case I need to reference one item on the
page that has an id of #_1740__ctl2__1125.  When I style this up in Firefox
it works fine. But it seems that IE gets stuck somewhere on the underscores
and ignores the rule.  I can't change the underscores because it is .net
generated - even though yes, I know that underscores are not recommended as
id values.  Can anyone help me on how I would get around this?
  
Reference it via some method other than #ID, such as Class.

If you need need #IDs you could generate a div within your selected frame by calling a function that optionally drawn html. Eg, (I haven't done C# for months and don't have a place to test this)

In ASPX:

<div id="<%# checkItem(DataBinder.Eval(Container, "ItemIndex")) %>">
    ...
</div>

and in codebehind,

 protected void checkItem(object itemIndex)
    {
    int itemItemInt = int.parse(itemIndex);
    if(itemIndexInt == yourItemNumber)
       {
        return "<div id=\"myId\">";
       }
    }



.Matthew Cruickshank
http://holloway.co.nz/



Reply via email to