Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7087183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:38:32+00:00 2026-05-28T07:38:32+00:00

I picked up some code that is building a Gridview with a SQLDataAdapter. One

  • 0

I picked up some code that is building a Gridview with a SQLDataAdapter.

One of the columns is an email address that I would like to make a hyper link to open Outlook (Users defautl email client).

The Gridview is all managed in code behind. Is there some way to do this?

Here is the code….

 If counter > 0 Then    
    Dim command4 As New SqlCommand(queryString4, connection) 
    Dim mySQLDataAdapter4 As New SqlDataAdapter(command4) 

    mySQLDataAdapter4.Fill(emailDataset, "needsEmail") 
 End If 
Next  
connection.Close() 


GridView4.DataSource = emailDataset 
GridView4.DataBind()

There is code that checks that data is returned that I have removed for readability.

I return 4 columns in the query. Everything works great, just want to make one of the columns and active email link.

Thanks,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T07:38:33+00:00Added an answer on May 28, 2026 at 7:38 am

    do this with a template field like so:

    <asp:TemplateField HeaderText="email">
        <ItemTemplate>
            <a href="mailto:<%# Bind("email") %>"><%# Bind("email") %></a>
        </ItemTemplate>
    </asp:TemplateField>
    

    should render

    |<a href="bob@bob.com">bob@bob.com</a>|
    

    Edit:

    You don’t need all the columns to be template fields. The rest of the columns can simply be like this:

    <asp:BoundField DataField="MyName" HeaderText="MyName"
            SortExpression="MyName" />
    <!--adding your templatefield-->
    <asp:TemplateField HeaderText="email">
        <ItemTemplate>
            <a href="mailto:<%# Bind("email") %>"><%# Bind("email") %></a>
        </ItemTemplate>
    </asp:TemplateField>
    

    You didn’t post any of your gridview code so I’m guessing about something of this. If you are trying to get the email out of the gridview in the code behind you can look at this link. It describes hiding an ID field but you should be able to do the same with the raw email address.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've picked up some old code that I need to work with and I
I've picked up some code from a colleague, and in one of his methods
I have some working Javascript code that generates an RDF/XML document using variables picked
So I picked up a job that requires me to fix some broken code
I've picked up some C# code recently and one of the classes has a
I just picked up a job where I'm to make some changes to a
I came across some code today that surprised me. A variable was defined (outside
I have a rather confusing issue. I've recently picked up some code I wrote
I have a problem with some simple code. The photo's, either picked or taken
Background I've picked up some incomplete work from another developer that involves displaying the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.