Custom databinding of a text box

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Keith G Hicks

    Custom databinding of a text box

    vwd 2005 express.

    when editing the CUSTOM databinding of a text box in a FormViews
    "ItemTempla te" I'd like to do this:

    Bind("[FirstName] & ' ' & [LastName]")

    Or if you prefer, this is the resultant ASP code from setting the property
    above:
    <asp:Label ID="FirstNameLa bel" runat="server" Text="<%#
    Bind(&quot;[FirstName] & ' ' & [LastName]&quot;) %>"
    Width="312px"></asp:Label>

    but that doesn't work. How do I construct the string so that the result is
    the concatenation of the FirstName and the LastName?



    Thanks,



    Keith


  • Keith G Hicks

    #2
    Re: Custom databinding of a text box

    I should point out that I know I can modify my SQL statement to return a
    column of the concatenated values or use a view that does the same. HOWEVER,
    one of the things many of the SQL gurus yell at everyone for over and over
    and over is DO THE FORMATTING IN THE CLIENT SIDE!!! NOT THE SQL SIDE!!!. I
    don't always agree with that philosophy but I'd like to know how to do this
    on the ASP side of things if it's possible.

    Keith


    "Keith G Hicks" <krh@comcast.ne twrote in message
    news:OHd1YS3aIH A.300@TK2MSFTNG P02.phx.gbl...
    vwd 2005 express.
    >
    when editing the CUSTOM databinding of a text box in a FormViews
    "ItemTempla te" I'd like to do this:
    >
    Bind("[FirstName] & ' ' & [LastName]")
    >
    Or if you prefer, this is the resultant ASP code from setting the property
    above:
    <asp:Label ID="FirstNameLa bel" runat="server" Text="<%#
    Bind(&quot;[FirstName] & ' ' & [LastName]&quot;) %>"
    Width="312px"></asp:Label>
    >
    but that doesn't work. How do I construct the string so that the result is
    the concatenation of the FirstName and the LastName?
    >
    >
    >
    Thanks,
    >
    >
    >
    Keith
    >
    >

    Comment

    • Jose A. Fernandez

      #3
      Re: Custom databinding of a text box

      Hello Keith
      It's posible, just help with String.Concat, and Eval dataitem not use
      Bind...
      Example:
      <asp:FormView ID="FormView1"
      ....
      <ItemTemplate >
      ....
      <asp:Label ID="lblDesc" runat="server" Text='<%#
      String.Concat(E val("CategoryID "), Eval("Descripti on"),
      Eval("CategoryI D")) %>'>
      ....


      Links:
      -----------------
      String..Concat Method
      Concatenates one or more instances of String, or the String
      representations of the values of one or more instances of Object.
      Concatenates one or more instances of String, or the String representations of the values of one or more instances of Object.


      I hope that you will help or guide
      _______________ _______
      Jose A. Fernandez
      blog: http://geeks.ms/blogs/fernandezja




      On 9 feb, 21:48, "Keith G Hicks" <k...@comcast.n etwrote:
      I should point out that I know I can modify my SQL statement to return a
      column of the concatenated values or use a view that does the same. HOWEVER,
      one of the things many of the SQL gurus yell at everyone for over and over
      and over is DO THE FORMATTING IN THE CLIENT SIDE!!! NOT THE SQL SIDE!!!. I
      don't always agree with that philosophy but I'd like to know how to do this
      on the ASP side of things if it's possible.
      >
      Keith
      >
      "Keith G Hicks" <k...@comcast.n etwrote in messagenews:OHd 1YS3aIHA.300@TK 2MSFTNGP02.phx. gbl...
      >
      vwd 2005 express.
      >
      when editing the CUSTOM databinding of a text box in a FormViews
      "ItemTempla te" I'd like to do this:
      >
      Bind("[FirstName] & ' ' & [LastName]")
      >
      Or if you prefer, this is the resultant ASP code from setting the property
      above:
      <asp:Label ID="FirstNameLa bel" runat="server" Text="<%#
      Bind(&quot;[FirstName] & ' ' & [LastName]&quot;) %>"
      Width="312px"></asp:Label>
      >
      but that doesn't work. How do I construct the string so that the result is
      the concatenation of the FirstName and the LastName?
      >
      Thanks,
      >
      Keith

      Comment

      • Keith G Hicks

        #4
        Re: Custom databinding of a text box

        Thank you.

        "Jose A. Fernandez" <fernandezja@gm ail.comwrote in message
        news:6fc1e9ea-4eb4-4491-a4f7-e64ed8fad733@v6 7g2000hse.googl egroups.com...
        Hello Keith
        It's posible, just help with String.Concat, and Eval dataitem not use
        Bind...
        Example:
        <asp:FormView ID="FormView1"
        ....
        <ItemTemplate >
        ....
        <asp:Label ID="lblDesc" runat="server" Text='<%#
        String.Concat(E val("CategoryID "), Eval("Descripti on"),
        Eval("CategoryI D")) %>'>
        ....
        >
        >
        Links:
        -----------------
        String..Concat Method
        Concatenates one or more instances of String, or the String
        representations of the values of one or more instances of Object.
        Concatenates one or more instances of String, or the String representations of the values of one or more instances of Object.

        >
        I hope that you will help or guide
        _______________ _______
        Jose A. Fernandez
        blog: http://geeks.ms/blogs/fernandezja
        >
        >
        >
        >
        On 9 feb, 21:48, "Keith G Hicks" <k...@comcast.n etwrote:
        I should point out that I know I can modify my SQL statement to return a
        column of the concatenated values or use a view that does the same.
        HOWEVER,
        one of the things many of the SQL gurus yell at everyone for over and
        over
        and over is DO THE FORMATTING IN THE CLIENT SIDE!!! NOT THE SQL SIDE!!!.
        I
        don't always agree with that philosophy but I'd like to know how to do
        this
        on the ASP side of things if it's possible.

        Keith

        "Keith G Hicks" <k...@comcast.n etwrote in
        messagenews:OHd 1YS3aIHA.300@TK 2MSFTNGP02.phx. gbl...
        vwd 2005 express.
        when editing the CUSTOM databinding of a text box in a FormViews
        "ItemTempla te" I'd like to do this:
        Bind("[FirstName] & ' ' & [LastName]")
        Or if you prefer, this is the resultant ASP code from setting the
        property
        above:
        <asp:Label ID="FirstNameLa bel" runat="server" Text="<%#
        Bind(&quot;[FirstName] & ' ' & [LastName]&quot;) %>"
        Width="312px"></asp:Label>
        but that doesn't work. How do I construct the string so that the
        result is
        the concatenation of the FirstName and the LastName?
        Thanks,
        Keith
        >

        Comment

        Working...