954,193 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Linking to E-mail through datagrid

Ok guys, here is what the problem is.

I have a column "reference number", now I want to make a column for "email" and depending what value is in the ref. No cell, the email will change accordingly, here is an example.

If the reference number is "THVP" then I want the email cell on the same row to be [email="zorba@hotmail.com"]zorba@hotmail.com[/email] and if the reference number is "SHVP" then I want the email cell on the same row to be [email="slade@hotmail.com"]slade@hotmail.com[/email] can anybody help me out here? Please?

Any help would be tremendously appreciated.

Slade
Practically a Master Poster
633 posts since Mar 2004
Reputation Points: 115
Solved Threads: 7
 

hey don't worry about it, I did it myself (I got lazy too), What I did was instead of worrying about that, I worried about the actual e-mail link in the datagrid even working. So I created another column in my database table called "Email" and manually entered the e-mails in according to ref. No. then for the e-mail column in the datagrid I used this code.

Inquire/Apply
Slade
Practically a Master Poster
633 posts since Mar 2004
Reputation Points: 115
Solved Threads: 7
 

my bad, I used this code

<asp:TemplateColumn SortExpression="Email" HeaderText="E-mail">
			<HeaderStyle Width="12%"></HeaderStyle>
			<ItemTemplate>
			 <asp:HyperLink id=lnkEmail runat="server" NavigateUrl='<%# "<A href="mailto:"&amp">mailto:"&amp; DataBinder.Eval(Container.DataItem,"Email") %>'>Inquire/Apply</asp:HyperLink>
			</ItemTemplate>
		   </asp:TemplateColumn>
Slade
Practically a Master Poster
633 posts since Mar 2004
Reputation Points: 115
Solved Threads: 7
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You