473,396 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

MailTo Link in GridView

How do you create a MailTo Link using the GridView Control with a boundfield
element:
<asp:BoundField HeaderText="Doc Group" DataField="strSubmitter" />

For example, I can use the following in the repeater control:
<a href="mailto:<%#Eval("strOwnerEmail")%>"><%#Eval(" strSubmitter")%></a>

--
Thanks in advance,
sck10
Nov 18 '05 #1
3 7228
Hi Sck10,

As for the problem you mentioned, here are some of my suggestions:

the GridView control infact is very similiar to the DataGrid control in the
current asp.net version which helps to
generate data display pages. And the BoundField in GridView is just the
same as the BoundColumn in the Datagrid , they are mainly focus on display
text datas on the page rather than other customized style. If we want to
build cutsomized style column(field), I suggest that we try the "template
field"(template column in datagrid),
For example:

<columnfields>
<asp:templatefield headertext="OrderID">
<itemtemplate>
<a href='<%# DataBinder.Eval(Container,
"DataItem.LinkUrl") %>'>
</asp:label>
</itemtemplate>
</asp:templatefield>

In addition, I think you can also try using the Datagrid / repeater
controls in asp.net1.1 so as to be more familiar with the asp.net Template
DAtaBound controls. That'll be more helpful.
If you have any other questions, please also feel free to post here. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Nov 18 '05 #2
Hi Sck10,

Have you had a chance to check the suggestions in my last reply or have you
got any further ideas? If there're any thing else we can help, please feel
free to post here.Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #3
I try the following code:
<asp:TemplateField headertext="Email">
<ItemTemplate>
<a href='<%#DataBinder.Eval(Container,
"DataItem.EmailAddress")%>' >
</ItemTemplate>
</asp:TemplateField>
but I want to get the email address from the database. I was not able to
display the email address in the gridview. Please let me know what is wrong
"sck10" wrote:
How do you create a MailTo Link using the GridView Control with a boundfield
element:
<asp:BoundField HeaderText="Doc Group" DataField="strSubmitter" />

For example, I can use the following in the repeater control:
<a href="mailto:<%#Eval("strOwnerEmail")%>"><%#Eval(" strSubmitter")%></a>

--
Thanks in advance,
sck10

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: nAmYzArC | last post by:
Hi everyone, I'm setting the body of an email using values from a form firstname = bob lastname = dole ebody = 'First Name: ' + firstname + '\r\n' + 'Last Name: ' + lastname ...
18
by: Shinin | last post by:
I am trying to set up a mailto: link so that the actual address that the email is being sent to is obscured and replaced by a name. For example, I have <a href="mailto:jschmoe@abc.com">Joe...
15
by: tshad | last post by:
I am trying to put an persons email address in a response I am sending another person. I can get it to work by doing the following: message.Body = resumeTop & vbCrLf & vbCrLf & "For Applicant:...
2
by: Marcial | last post by:
Hello, I have a ASP.NET 2.0 coding issue I need help with. I have a Gridview which displays the Name and e-mail address columns of an underlying SQL datasource. I added a hyperlink field to...
4
by: Stuart Ferguson | last post by:
I am currently writing an application in ASP.Net which has a bound Gridview however i require to add a column with a mailto link in it. After many questions in the c# IRC room it was decided that a...
2
by: Arvan | last post by:
hi,all. i wanna use Eval("DataField") to bind datarow in item template of GridView. for example: <asp:Label runat="server" id="Label1" text='<%# Eval("DataField") %>'><asp:Label> but how...
2
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
Hi, I want to create a mailto link from data coming from an SQLDataSource. How do I have to change the following code to get it working? The mailto works, outlook starts with a new message, but...
4
by: Jeff | last post by:
Hi, I have a ASP.NET 2.0 Web Application. Many of the pages use the ASP.NET GridView with paging and sorting. One of the columns of this Gridview is a template column (LinkButton). The data being...
9
by: lilOlMe | last post by:
Hi there! I have generated a GridView that looks something like: SportName| CompanyNameX |CompanyNameY |CompanyNameZ Hockey.....| Shipping------------ |Accounting-------- |Shipping------------...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.