Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

href in SELECT statement

Status
Not open for further replies.

LouisC4

Programmer
Jul 26, 2003
54
US
Hello I am using a ViewGrid and I will like to display a email hyperlink in the grid. I've read that I should put an href on my SELECT statement but is not working, this is the code I have:

Code:
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:myConnectString %>" SelectCommand="SELECT [Category], [ContactName], [<a href='mailto: EmailInfo' >] FROM [Ads] ORDER BY [Category]"></asp:SqlDataSource>

EmailInfo is a field in my table.

Thanks for your help,

Louis
 
I'm not sure where you've read that you should return HTML in your SQL Statement but that is bad advice. You should only return the data from the database and let the front end display it as necessary. In this case a HyperLinkField would be one such method.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I return html in Select statements sometimes but mainly for AJAX stuff (like dynamically building a gridview). But I agree with ca8msm, if you can get around it then you should because it can get messy quickly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top