change backcolor of cell in runtime

Discussion in 'ASP .Net' started by rjl, Nov 22, 2005.

  1. rjl

    rjl Guest

    I have a td column. I want to check a properties file when page is
    loaded to set the color. This is what I have :
    <td style="background-color:<%#MyColor.getColor%>> and I have tried:
    <td style="background-color:<%=MyColor.getColor%>>
    I get a formatter exception. If I take the same code and use
    <td style="background-color:<%=MyColor.getColor%>> in the body, it
    does show the string I have for MyColor.getColor.
    Thanks for any help.
     
    rjl, Nov 22, 2005
    #1
    1. Advertising

  2. try this instead

    <%#MyColor-getColor%>

    Let me know if it helps

    regard
    serge

    "rjl" wrote:

    > I have a td column. I want to check a properties file when page is
    > loaded to set the color. This is what I have :
    > <td style="background-color:<%#MyColor.getColor%>> and I have tried:
    > <td style="background-color:<%=MyColor.getColor%>>
    > I get a formatter exception. If I take the same code and use
    > <td style="background-color:<%=MyColor.getColor%>> in the body, it
    > does show the string I have for MyColor.getColor.
    > Thanks for any help.
    >
    >
     
    =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=, Nov 22, 2005
    #2
    1. Advertising

  3. rjl

    rjl Guest

    Thanks for the response, but isn't this the same I have in my post?
    <td style="background-color:<%=MyColor.getColor%>>
    or are you sayng leave off the last'>', which i think i tried?


    serge calderara wrote:
    > try this instead
    >
    > <%#MyColor-getColor%>
    >
    > Let me know if it helps
    >
    > regard
    > serge
    >
    > "rjl" wrote:
    >
    > > I have a td column. I want to check a properties file when page is
    > > loaded to set the color. This is what I have :
    > > <td style="background-color:<%#MyColor.getColor%>> and I have tried:
    > > <td style="background-color:<%=MyColor.getColor%>>
    > > I get a formatter exception. If I take the same code and use
    > > <td style="background-color:<%=MyColor.getColor%>> in the body, it
    > > does show the string I have for MyColor.getColor.
    > > Thanks for any help.Than
    > >
    > >
     
    rjl, Nov 22, 2005
    #3
  4. no its not the same,
    I guess that you try to call a property of a class inside HTM so in order to
    call it like:

    MyControl.Getcolor use Mycontrol-getColor

    let me know

    "rjl" wrote:

    > Thanks for the response, but isn't this the same I have in my post?
    > <td style="background-color:<%=MyColor.getColor%>>
    > or are you sayng leave off the last'>', which i think i tried?
    >
    >
    > serge calderara wrote:
    > > try this instead
    > >
    > > <%#MyColor-getColor%>
    > >
    > > Let me know if it helps
    > >
    > > regard
    > > serge
    > >
    > > "rjl" wrote:
    > >
    > > > I have a td column. I want to check a properties file when page is
    > > > loaded to set the color. This is what I have :
    > > > <td style="background-color:<%#MyColor.getColor%>> and I have tried:
    > > > <td style="background-color:<%=MyColor.getColor%>>
    > > > I get a formatter exception. If I take the same code and use
    > > > <td style="background-color:<%=MyColor.getColor%>> in the body, it
    > > > does show the string I have for MyColor.getColor.
    > > > Thanks for any help.Than
    > > >
    > > >

    >
    >
     
    =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=, Nov 23, 2005
    #4
  5. what is myControl ?

    you could try also :
    <td style="background-color:" & '<%#MyColor.getColor%>'>

    "rjl" wrote:

    > Thanks for the response, but isn't this the same I have in my post?
    > <td style="background-color:<%=MyColor.getColor%>>
    > or are you sayng leave off the last'>', which i think i tried?
    >
    >
    > serge calderara wrote:
    > > try this instead
    > >
    > > <%#MyColor-getColor%>
    > >
    > > Let me know if it helps
    > >
    > > regard
    > > serge
    > >
    > > "rjl" wrote:
    > >
    > > > I have a td column. I want to check a properties file when page is
    > > > loaded to set the color. This is what I have :
    > > > <td style="background-color:<%#MyColor.getColor%>> and I have tried:
    > > > <td style="background-color:<%=MyColor.getColor%>>
    > > > I get a formatter exception. If I take the same code and use
    > > > <td style="background-color:<%=MyColor.getColor%>> in the body, it
    > > > does show the string I have for MyColor.getColor.
    > > > Thanks for any help.Than
    > > >
    > > >

    >
    >
     
    =?Utf-8?B?c2VyZ2UgY2FsZGVyYXJh?=, Nov 23, 2005
    #5
  6. rjl

    rjl Guest

    Serge,
    I am not using MyControl anywhere. MyColor is a class and getColor
    returns a string like "blue".

    when I use :<%=MyColor.getColor%> in the boyd of HTML, I do get blue in
    the HTML.

    Thanks,
    Joe


    serge calderara wrote:
    > what is myControl ?
    >
    > you could try also :
    > <td style="background-color:" & '<%#MyColor.getColor%>'>
    >
    > "rjl" wrote:
    >
    > > Thanks for the response, but isn't this the same I have in my post?
    > > <td style="background-color:<%=MyColor.getColor%>>
    > > or are you sayng leave off the last'>', which i think i tried?
    > >
    > >
    > > serge calderara wrote:
    > > > try this instead
    > > >
    > > > <%#MyColor-getColor%>
    > > >
    > > > Let me know if it helps
    > > >
    > > > regard
    > > > serge
    > > >
    > > > "rjl" wrote:
    > > >
    > > > > I have a td column. I want to check a properties file when page is
    > > > > loaded to set the color. This is what I have :
    > > > > <td style="background-color:<%#MyColor.getColor%>> and I have tried:
    > > > > <td style="background-color:<%=MyColor.getColor%>>
    > > > > I get a formatter exception. If I take the same code and use
    > > > > <td style="background-color:<%=MyColor.getColor%>> in the body, it
    > > > > does show the string I have for MyColor.getColor.
    > > > > Thanks for any help.Than
    > > > >
    > > > >

    > >
    > >
     
    rjl, Nov 23, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jm
    Replies:
    3
    Views:
    2,908
  2. Franck
    Replies:
    1
    Views:
    724
    Eliyahu Goldin
    Jun 7, 2005
  3. Mike P
    Replies:
    1
    Views:
    3,895
    harlequinben
    Aug 30, 2006
  4. Todd Q

    Setting cell backcolor

    Todd Q, Aug 18, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    174
    Todd Q
    Aug 19, 2004
  5. feel

    how to change backcolor on cell at runtime for c# ?

    feel, Jul 27, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    176
    Eliyahu Goldin
    Jul 27, 2005
Loading...

Share This Page