More in this section
Forums / Developing with Sitefinity / How to get String.Format to work within User Profile widget template?

How to get String.Format to work within User Profile widget template?

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
1 posts, 0 answered
  1. Alex
    Alex avatar
    1 posts
    Registered:
    18 Apr 2013
    07 Feb 2017
    Link to this post

    I am developing a widget template for our user profile control in SF 6.1. When I try to use String.Format to display FirstName and LastName together, I get nothing displayed on the web when I run it. I have tried using sf:TextField as well as just asp:labels with the same Evals, nothing seems to work.

    Is there an easy way to do this? Here is the code I'm attempting to use:

     <div class="blog-author-name">
                            <sf:TextField ID="txtName" runat="server" DisplayMode="Read" Value='<%# String.Format("{0} {1}", Eval("FirstName"),Eval("LastName"))%>' />
                        
                        </div>

     

1 posts, 0 answered