troubleshooting Question

Using Enum in aspx page?

Avatar of ApexCo
ApexCoFlag for United States of America asked on
ASP.NET
4 Comments1 Solution1662 ViewsLast Modified:
I've got a datalist  that looks like this:

                    <asp:DataList ID="DataList1" runat="server" CellPadding="4" DataSourceID="SqlDataSource1"
                        ForeColor="#333333">
                        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                        <SelectedItemStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                        <ItemTemplate>
                            <b><asp:Label ID="DisplayNameLabel" runat="server" Text='<%# Eval("DisplayName") %>'></asp:Label></b><br />
                            OfficeLocation:
                            <asp:Label ID="OfficeLocationLabel" runat="server" Text='<%# Eval("OfficeLocation") %>'></asp:Label><br />
                            <asp:Label ID="PhoneLabel" runat="server" Text='<%# "(" & CType(Eval("Phone"),String).SubString(0,3) & ")" & " " & CType(Eval("Phone"),String).SubString(3,3) & "-" & CType(Eval("Phone"),String).SubString(6,4)   %>'></asp:Label><br />
                            <a href="mailto:<%# Eval("Email") %>"><%# Eval("Email") %></a><br />
                            AttorneyType:
                            <asp:Label ID="AttorneyTypeLabel" runat="server" Text='<%# Eval("AttorneyType") %>'></asp:Label><br />
                            <br />
                        </ItemTemplate>
                        <AlternatingItemStyle BackColor="White" />
                        <ItemStyle BackColor="#E3EAEB" />
                        <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                    </asp:DataList>

There are two things that I am going to need an enum for, AttorneyType and OfficeLocation. But I don't know how to do this all that well. I have done a couple of enums in code-behind for a 3rd party API, but I didn't actually have to process them, I just passed the enum ID for their API, so it was easy.

My question is how do i build 2 enums for these items and then use them in the aspx page?

Thanks.
ASKER CERTIFIED SOLUTION
nepali

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros