protected void grdmissedapp_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "Message") { GridViewRow row = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer); HiddenField hdnEmail = (HiddenField)row.Cells[2].FindControl("hdnEmail"); string email = e.CommandArgument.ToString(); if (!string.IsNullOrEmpty(email)) { Outlook.Application oApp = new Outlook.Application(); Outlook._MailItem oMailItem = (Outlook._MailItem)oApp.CreateItem(Outlook.OlItemType.olMailItem); oMailItem.To = email; // body, bcc etc... oMailItem.Display(true); } } if (e.CommandName == "Call") { GridViewRow row = (GridViewRow)(((ImageButton)e.CommandSource).NamingContainer); Label lblcall = (Label)row.Cells[1].FindControl("lblcall"); ImageButton btncall = (ImageButton)row.Cells[1].FindControl("btncall"); if (lblcall != null) { lblcall.Visible = true; lblcall.Text = e.CommandArgument.ToString(); btncall.Visible = false; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)