Can I easily trim the whitespace for a databound HyperLinkColumn?

Discussion in 'ASP .Net' started by Sean Aitken, May 20, 2005.

  1. Sean Aitken

    Sean Aitken Guest

    Does anyone know the easiest way to trim the whitespace from a CHAR(...)
    bound value coming from a database and used with a HyperLinkColumn?

    In this case, the column is setup using:
    ....
    <asp:HyperLinkColumn Text="Edit Taxes" DataNavigateUrlField="AccountID"
    DataNavigateUrlFormatString="TaxDetail.aspx?id={0}&amp;src=accts"></asp:HyperLinkColumn>
    ....

    The problem is that the output looks like:
    ".../TaxDetail.aspx?id=00044%20%20%20%20%20%20%20%20%20%20%20&src=accts"

    So, I want to trim the data from the DB before it binds to the column
    for all rows.

    I have looked at the format string options, but I can't see any way to
    do it with the format string.

    Any ideas?

    Cheers!
    -Sean
     
    Sean Aitken, May 20, 2005
    #1
    1. Advertising

  2. Select RTRIM(AccountID) As AccountID, ... From ...

    HTH

    Elton Wang



    "Sean Aitken" wrote:

    > Does anyone know the easiest way to trim the whitespace from a CHAR(...)
    > bound value coming from a database and used with a HyperLinkColumn?
    >
    > In this case, the column is setup using:
    > ....
    > <asp:HyperLinkColumn Text="Edit Taxes" DataNavigateUrlField="AccountID"
    > DataNavigateUrlFormatString="TaxDetail.aspx?id={0}&src=accts"></asp:HyperLinkColumn>
    > ....
    >
    > The problem is that the output looks like:
    > ".../TaxDetail.aspx?id=00044%20%20%20%20%20%20%20%20%20%20%20&src=accts"
    >
    > So, I want to trim the data from the DB before it binds to the column
    > for all rows.
    >
    > I have looked at the format string options, but I can't see any way to
    > do it with the format string.
    >
    > Any ideas?
    >
    > Cheers!
    > -Sean
    >
     
    =?Utf-8?B?RWx0b24gVw==?=, May 20, 2005
    #2
    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. FAQ server
    Replies:
    0
    Views:
    142
    FAQ server
    Aug 29, 2006
  2. FAQ server
    Replies:
    0
    Views:
    141
    FAQ server
    Oct 26, 2006
  3. FAQ server
    Replies:
    6
    Views:
    219
    Jonas Raoni
    Dec 25, 2006
  4. FAQ server
    Replies:
    26
    Views:
    300
    Dr J R Stockton
    Feb 26, 2007
  5. FAQ server
    Replies:
    2
    Views:
    135
    -Lost
    Apr 24, 2007
Loading...

Share This Page