Click here to Skip to main content
14,546,413 members
   

C#

 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 14:18
MemberExoskeletor9-Mar-20 14:18 
PraiseRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen10-Mar-20 1:44
professionalEddy Vluggen10-Mar-20 1:44 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen9-Mar-20 2:23
professionalEddy Vluggen9-Mar-20 2:23 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 0:26
MemberExoskeletor9-Mar-20 0:26 
QuestionHow do I make table data red in <td>? Pin
Member 114033044-Mar-20 8:33
MemberMember 114033044-Mar-20 8:33 
AnswerRe: How do I make table data red in <td>? Pin
Richard Deeming4-Mar-20 8:50
mveRichard Deeming4-Mar-20 8:50 
GeneralRe: How do I make table data red in <td>? Pin
Member 114033044-Mar-20 8:59
MemberMember 114033044-Mar-20 8:59 
GeneralRe: How do I make table data red in <td>? Pin
Richard Deeming4-Mar-20 23:58
mveRichard Deeming4-Mar-20 23:58 
You still need to HTML-encode the database values. And the solution to your original question is still the same: add a CSS class to the parent element of the text you want to style.

I also think you can tidy that code up somewhat, and avoid having to build the HTML as a string:
<asp:TemplateField HeaderText="Attorney" HeaderStyle-HorizontalAlign="Justify" ItemStyle-Width="25%">
    <ItemTemplate>
        <asp:MultiView runat="server" ActiveViewIndex='<%# Eval("AttorneyPartyID", "{0}") != Eval("PartyID", "{0}") ? 0 : 1 %>'>
        <asp:View runat="server">
            <table>
            <tr>
                <td class="attorney-full-name"><%#: Eval("AttorneyFullName") %></td>
            </tr>
            <asp:Placeholder runat="server" visible='<%# !string.IsNullOrEmpty(Eval("AttorneyPhoneNumber", "{0}")) %>'>
            <tr>
                <td class="attorney-phone-number">Phone: <%#: Eval("AttorneyPhoneNumber") %></td>
            </tr>
            </asp:Placeholder>
            <asp:Placeholder runat="server" visible='<%# !string.IsNullOrEmpty(Eval("AttorneyEmail", "{0}")) %>'>
            <tr>
                <td class="attorney-email">Email: <%#: Eval("AttorneyEmail") %></td>
            </tr>
            </asp:Placeholder>
            </table>
        </asp:View>
        <asp:View runat="server">
            Pro Se
        </asp:View>
        </asp:MultiView>
    </ItemTemplate>
</asp:TemplateField>
NB: Using <%#: ... %> instead of <%# ... %> - note the extra : at the start - will automatically HTML-encode the output for you.

MultiView Class (System.Web.UI.WebControls) | Microsoft Docs[^]



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer

GeneralRe: How do I make table data red in <td>? Pin
Member 114033049-Mar-20 4:36
MemberMember 114033049-Mar-20 4:36 
GeneralRe: How do I make table data red in <td>? Pin
Richard Deeming9-Mar-20 8:36
mveRichard Deeming9-Mar-20 8:36 
GeneralRe: How do I make table data red in <td>? Pin
Member 114033049-Mar-20 9:41
MemberMember 114033049-Mar-20 9:41 
GeneralRe: How do I make table data red in <td>? Pin
Richard Deeming9-Mar-20 9:53
mveRichard Deeming9-Mar-20 9:53 
GeneralRe: How do I make table data red in <td>? Pin
Member 114033049-Mar-20 11:45
MemberMember 114033049-Mar-20 11:45 
GeneralRe: How do I make table data red in <td>? Pin
Richard Deeming10-Mar-20 0:14
mveRichard Deeming10-Mar-20 0:14 
GeneralRe: How do I make table data red in <td>? Pin
Member 1140330412-Mar-20 4:08
MemberMember 1140330412-Mar-20 4:08 
QuestionHow to capture credentials / auth token from Windows credential popup dialog? Pin
S p k 5214-Mar-20 0:27
MemberS p k 5214-Mar-20 0:27 
AnswerRe: How to capture credentials / auth token from Windows credential popup dialog? Pin
Richard MacCutchan4-Mar-20 0:37
mveRichard MacCutchan4-Mar-20 0:37 
GeneralRe: How to capture credentials / auth token from Windows credential popup dialog? Pin
S p k 5214-Mar-20 2:03
MemberS p k 5214-Mar-20 2:03 
Questionforeach loop behavior C# Pin
picasso22-Mar-20 18:55
Memberpicasso22-Mar-20 18:55 
AnswerRe: foreach loop behavior C# Pin
Pete O'Hanlon2-Mar-20 20:17
subeditorPete O'Hanlon2-Mar-20 20:17 
AnswerRe: foreach loop behavior C# Pin
OriginalGriff2-Mar-20 20:23
mveOriginalGriff2-Mar-20 20:23 
AnswerRe: foreach loop behavior C# Pin
lmoelleb3-Mar-20 23:01
Memberlmoelleb3-Mar-20 23:01 
QuestionIgroupping with Parallel Pin
Member 110035101-Mar-20 6:58
MemberMember 110035101-Mar-20 6:58 
AnswerRe: Igroupping with Parallel Pin
Dave Kreskowiak1-Mar-20 7:39
mveDave Kreskowiak1-Mar-20 7:39 
GeneralRe: Igroupping with Parallel Pin
Member 110035101-Mar-20 7:46
MemberMember 110035101-Mar-20 7:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.