how to get clickable email from aspnetdb?

M

Mich

Hi,

I can fetch the mailaddresses from table aspnet_membership in a gridview. I
just create a sqldatasource and a gridview and this sql statement, all in
the aspx file.

SelectCommand="select aspnet_Users.UserName as Lid, aspnet_Membership.Email
as Emailadres FROM aspnet_Membership INNER JOIN aspnet_Users ON
aspnet_Membership.UserId = aspnet_Users.UserId "


But i want to be able to click on those mailaddresses and so starting my
outlook.

Thanks for help.
 
G

George Ter-Saakov

You must have following html in order to make it clickable

<a hef="mailto:[email protected]">email</a>


PS: Look up mailto tag, you can automatically prepopulate subj and message
body also.
George.
 
M

Mich

Thanks, i know this tag. My problem is: how to integrate it in the sql
statement in the aspx file?
I tried this, but get an error "tag not wel formed":

SelectCommand="select aspnet_Users.UserName as Lid, " & "<a href='mailto:'"
& "aspnet_Membership.Email" & ">email</a> as Emailadres FROM
aspnet_Membership INNER JOIN aspnet_Users ON aspnet_Membership.UserId =
aspnet_Users.UserId ">
 
M

Mich

I also tried this but same error:

SelectCommand="select aspnet_Users.UserName as Lid, + '<a href=' +
'"mailto:"' + aspnet_Membership.Email +'>' + aspnet_Membership.Email + '
</a>' as Emailadres FROM aspnet_Membership INNER JOIN aspnet_Users ON
aspnet_Membership.UserId = aspnet_Users.UserId ">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,161
Latest member
GertrudeMa
Top