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
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to append static text to a bound field? [modified]

How to append static text to a bound field? [modified]

Scheduled Pinned Locked Moved ASP.NET
helpcsharptutorialquestion
3 Posts 2 Posters 0 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.
  • K Offline
    K Offline
    KreativeKai
    wrote on last edited by
    #1

    I am trying to append static text to a bound field in the range validator ErrorMessage field.   The code below works fine but as soon as I try to append any static text it either throws an error or just displays the static text. Any help would be appreicated.

    Lost in the vast sea of .NET

    modified on Wednesday, June 17, 2009 7:50 AM

    C 1 Reply Last reply
    0
    • K KreativeKai

      I am trying to append static text to a bound field in the range validator ErrorMessage field.   The code below works fine but as soon as I try to append any static text it either throws an error or just displays the static text. Any help would be appreicated.

      Lost in the vast sea of .NET

      modified on Wednesday, June 17, 2009 7:50 AM

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      KreativeKai wrote:

      ErrorMessage='<%# Bind("item_short_desc")%>'

      ErrorMessage='This is an error, it is described as : <%# Bind("item_short_desc")%>' should work. Or ErrorMessage='<%=string.Format("This is an error, it is {0}", Bind("item_short_desc"))%>' should also work. Bind, is that right ? I thought it was Eval ?

      Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

      K 1 Reply Last reply
      0
      • C Christian Graus

        KreativeKai wrote:

        ErrorMessage='<%# Bind("item_short_desc")%>'

        ErrorMessage='This is an error, it is described as : <%# Bind("item_short_desc")%>' should work. Or ErrorMessage='<%=string.Format("This is an error, it is {0}", Bind("item_short_desc"))%>' should also work. Bind, is that right ? I thought it was Eval ?

        Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

        K Offline
        K Offline
        KreativeKai
        wrote on last edited by
        #3

        Hi Christian, I wasn’t able to get your first suggestion to work but I was able to get your second suggestion to work. You were correct it didn’t work with Bind I needed to substitute for eval. I am not sure why because if you don’t want to append any text bind works just fine. This is the code I ended up using:

        ErrorMessage='<%# string.Format("Invalid Qty for {0}", eval("item_short_desc")) %>

        Thanks for you assistance.

        Lost in the vast sea of .NET

        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