Hi
I am using the following code in a Gridview to display a link to generate an e-mail to an email address obtained from a database:
Code:
<asp:TemplateField HeaderText="Email">
<ItemTemplate>
<asp:HyperLink ID="EmailLink" text='e-Mail'
NavigateUrl='<%# Eval("eMail","mailto:{0}?Subject=Enquiry from Cobham Chamber Website")%>'
runat="server"
target="_blank" />
</ItemTemplate>
I am using text='e-Mail' as I am restricted in width and the email address that will be displayed by using text='<%# Bind("eMail") %>' is too long.
The latter has the advantage that the column is blank if no e-mail address exists (ConvertEmptyStringtoNull set to TRUE)
But with text='e-mail' the records with an address get the word e-mail as a link whilst those without get the word e-Mail without a link.
Can I hide the text when there is no data in the field?