SQL passing value to website, but value gets left justfied - why?

  • select left('Major2:' + space(20), 20) + (select major2 from allmajors where UniqueId=@userid)

    gives me the following when i run the SP in SSMS.

    Major2: not applicable

    which is correct.

    But in asp.net:

    <asp:Label ID="Label6" Text='<%#Eval("Major2") %>' Width="375px" runat="server"></asp:Label>

    I get the following displayed on the website, why?

    Major2: not applicable

    Thanks

  • You should use non-breaking spaces instead of soft spaces.

    Try replacing char(20) with "& nbsp;"

    Hope this helps

    Gianluca

    Edited: remove the space between the "&" and "nbsp;". I had to post it like that because it kept getting replaced with a whitespace.

    -- Gianluca Sartori

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply