如何使GridView中的Username列成为电子邮件超链接并且可单击? [英] How to make the Username column in the GridView an email hyperlink and to be clickable?

查看:95
本文介绍了如何使GridView中的Username列成为电子邮件超链接并且可单击?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个基于Web的培训矩阵,该矩阵显示了公司部门中每个部门的每位员工的培训记录.矩阵将显示许多列,例如员工名称,用户名,职务等.我现在要使每个员工的用户名都可单击,这意味着当管理员单击该用户名时,将打开前景与他的电子邮件,管理员将能够向他发送消息.在我公司中,这是可能的,因为每个员工的电子邮件主要是:username@companyName.com,所以该怎么做?

顺便说一句,将使用存储过程从数据库中检索员工的用户名,那么如何使用Code-Behind将用户名转换为电子邮件并同时可单击?

用户列是GridView

I developed a web-based training matrix that shows the training record for each employee in each division in my department in the company. The matrix will show many columns such as the employee name, username, job title... etc. what I want now is to make the username for each employee to be clickable which means when the admin clicks on it, the outlook will be opened with his email and the admin will be able to send him a message. In my company, this is possible because each employee email is mainly as: username@companyName.com so how to do that?

By the way, the username of the employee will be retrieved from the database using a storedprocedure, so how I will be able to convert the username to an email and to be clickable at the same time using the Code-Behind?

The user column is the 4th column in the GridView

推荐答案

在GridView_CellClick事件上的第四列:-

System.Diagnstics.Process.Start("Desire EmailId");
Try this on GridView_CellClick event:-

System.Diagnstics.Process.Start("Desire EmailId");


这篇关于如何使GridView中的Username列成为电子邮件超链接并且可单击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆