Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Add a hyperlink to a data view control

Avatar of russomr
russomr asked on
ASP.NET
4 Comments1 Solution583 ViewsLast Modified:
I have the following:

<asp:GridView ID="gvResults" runat="server" Width="100%" AutoGenerateColumns="false" CellPadding="4" ForeColor="#333333"
    GridLines="None">
    <Columns>
        <asp:BoundField ReadOnly="true" HeaderText="DBA Name" DataField="DBAName" />
        <asp:BoundField ReadOnly="true" HeaderText="City" DataField="City" />
        <asp:BoundField ReadOnly="true" HeaderText="State" DataField="State" />
        <asp:BoundField ReadOnly="true" HeaderText="P&C Volume" DataField="PCVolume" />
        <asp:BoundField ReadOnly="true" HeaderText="Life Vol" DataField="LifeVolume" />
        <asp:BoundField ReadOnly="true" HeaderText="Field Rep" DataField="PCFieldRep" />
    </Columns>
</asp:GridView>

I get a view with all of the fields displaying correctly, but for the DBAName, I actually want to display the DBAName, but have it be a hyperlink that opens a new window with the URL (which is contained in the datasource as 'Website').  If 'Website' is null or empty, it does not show the DBAName as a hyplerlink, but just text.

Can anyone help?  This is my first exposure to a dataview.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of strickdd
strickddFlag of United States of America image

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

Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answers