Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Set server variable as forecolor propery value

Set server variable as forecolor propery value

Scheduled Pinned Locked Moved ASP.NET
sysadminhelp
6 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    benams
    wrote on last edited by
    #1

    I try to do this textColor is a server variable of type Color(Color textColor=Color.Red), I tried to make it a string variable, it didn't help...

    A 1 Reply Last reply
    0
    • B benams

      I try to do this textColor is a server variable of type Color(Color textColor=Color.Red), I tried to make it a string variable, it didn't help...

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      benams wrote:

      I try to do this textColor is a server variable of type Color(Color textColor=Color.Red), I tried to make it a string variable, it didn't

      so why you are not setting it at codebehind itself ? just try this,

      lnb.ForeColor = Color.Red

      Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Visit My Latest Article : Beginner's Guide : Exploring IIS 6.0 With ASP.NET

      B 1 Reply Last reply
      0
      • A Abhijit Jana

        benams wrote:

        I try to do this textColor is a server variable of type Color(Color textColor=Color.Red), I tried to make it a string variable, it didn't

        so why you are not setting it at codebehind itself ? just try this,

        lnb.ForeColor = Color.Red

        Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Visit My Latest Article : Beginner's Guide : Exploring IIS 6.0 With ASP.NET

        B Offline
        B Offline
        benams
        wrote on last edited by
        #3

        it's not possible because it's in a repeater...

        A 1 Reply Last reply
        0
        • B benams

          it's not possible because it's in a repeater...

          A Offline
          A Offline
          Abhijit Jana
          wrote on last edited by
          #4

          You didn't mentioned it earlier. Please show us your code that you have written to show records in repeater. that may help you.

          Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Visit My Latest Article : Beginner's Guide : Exploring IIS 6.0 With ASP.NET

          B 1 Reply Last reply
          0
          • A Abhijit Jana

            You didn't mentioned it earlier. Please show us your code that you have written to show records in repeater. that may help you.

            Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Visit My Latest Article : Beginner's Guide : Exploring IIS 6.0 With ASP.NET

            B Offline
            B Offline
            benams
            wrote on last edited by
            #5

            first of all, thanks for your responses, the code: <asp:Repeater ID="rpt1" runat="server" DataSource="<%#airplanes %>"> <ItemTemplate> <asp:LinkButton ID="lnb1" runat="server" Text='<%#Eval("Type")' %> %>' ForeColor='<%=textColor %>' /> </ItemTemplate> </asp:Repeater>

            N 1 Reply Last reply
            0
            • B benams

              first of all, thanks for your responses, the code: <asp:Repeater ID="rpt1" runat="server" DataSource="<%#airplanes %>"> <ItemTemplate> <asp:LinkButton ID="lnb1" runat="server" Text='<%#Eval("Type")' %> %>' ForeColor='<%=textColor %>' /> </ItemTemplate> </asp:Repeater>

              N Offline
              N Offline
              Nisha Agrawal
              wrote on last edited by
              #6

              i think still u can do it with the help of ItemDataBound Event. Just handle the ItemDataBound Event. In that handler, find out the control via e.Item.FindControl("lnb1") and then set the color as u wish.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups