i filled a gridview with tblUser, now gridview has a checkbox file (status), which is used to activate newly registered users,
so i want to inform user via mail when admins activates him, mean when i (admin) checks checkbox field true, in edit mode of girdview then at that moment the user should get notification that u have been activated ,
mail code , + other neccessary code is prepared but i can't figure out that how to send mail at that time when i click check box, :(
here is my code :
<%@ Page Language="C#" MasterPageFile="~/MasterPageAdministration.master" AutoEventWireup="true" CodeFile="adminViewEmployers.aspx.cs" Inherits="adminViewEmployers" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="superAdminContent">
<h3>Employers</h3>
<asp:TextBox ID="txtboxEmplyrName" runat="server"></asp:TextBox>
<asp:Button ID="btnSrchEmplyrName" runat="server" Text="Search"
style="height: 26px" onclick="btnSrchEmplyrName_Click" />
Or
<asp:Button ID="btnViewAllEmplyrs" runat="server" Text="View All"
onclick="btnViewAllEmplyrs_Click" />
<asp:Button ID="btnClrScreen" runat="server" Text="Clear" />
</div>
<div class="superAdminGridViewContent" >
<asp:GridView ID="GridViewAdminViewEmplys" runat="server" AllowPaging="True"
AutoGenerateColumns="False" DataKeyNames="userid"
DataSourceID="SqlDataSource1" AllowSorting="True">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:HyperLinkField DataNavigateUrlFields="userid"
DataNavigateUrlFormatString="~/adminViewEmplyrFurther.aspx?userid={0}"
DataTextField="userid" DataTextFormatString="{0}" HeaderText="Userid"
InsertVisible="False" NavigateUrl="~/adminViewEmplyrFurther.aspx"
SortExpression="userid" />
<asp:BoundField DataField="fullname" HeaderText="fullname"
SortExpression="fullname" />
<asp:BoundField DataField="email" HeaderText="email" SortExpression="email" />
<asp:BoundField DataField="question" HeaderText="question"
SortExpression="question" />
<asp:BoundField DataField="answers" HeaderText="answers"
SortExpression="answers" />
<asp:BoundField DataField="doc" HeaderText="doc" SortExpression="doc" />
<asp:BoundField DataField="roleid" HeaderText="roleid"
SortExpression="roleid" />
<asp:CheckBoxField DataField="active" HeaderText="Status" SortExpression="active" ReadOnly="false" />
</Columns>
</asp:GridView>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True"
AllowSorting="True" AutoGenerateColumns="False" CellPadding="4"
DataKeyNames="userid" DataSourceID="SqlDataSource2" ForeColor="#333333"
Visible="false"
GridLines="None">
<RowStyle BackColor="#E3EAEB" />
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:HyperLinkField DataNavigateUrlFields="userid"
DataNavigateUrlFormatString="~/adminViewEmplyrFurther.aspx?userid={0}"
DataTextField="userid" DataTextFormatString="{0}" HeaderText="Userid"
InsertVisible="False" NavigateUrl="~/adminViewEmplyrFurther.aspx"
SortExpression="userid" />
<asp:BoundField DataField="fullname" HeaderText="fullname"
SortExpression="fullname" />
<asp:BoundField DataField="email" HeaderText="email" SortExpression="email" />
<asp:BoundField DataField="question" HeaderText="question"
SortExpression="question" />
<asp:BoundField DataField="answers" HeaderText="answers"
SortExpression="answers" />
<asp:BoundField DataField="doc" HeaderText="doc" SortExpression="doc" />
<asp:BoundField DataField="roleid" HeaderText="roleid"
SortExpression="roleid" />
</Columns>
<FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#7C6F57" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server"
ConnectionString="<%$ ConnectionStrings:Waleed_orsfinalConnectionString7 %>"
DeleteCommand="DELETE FROM [tblUser] WHERE [userid] = @userid"
InsertCommand="INSERT INTO [tblUser] ([fullname], [email], [question], [answers], [doc], [roleid]) VALUES (@fullname, @email, @question, @answers, @doc, @roleid)"
SelectCommand="SELECT [userid], [fullname], [email], [question], [answers], [doc], [roleid] FROM [tblUser] where roleid=2"
UpdateCommand="UPDATE [tblUser] SET [fullname] = @fullname, [email] = @email, [question] = @question, [answers] = @answers, [doc] = @doc, [roleid] = @roleid WHERE [userid] = @userid">
<DeleteParameters>
<asp:Parameter Name="userid" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="fullname" Type="String" />
<asp:Parameter Name="email" Type="String" />
<asp:Parameter Name="question" Type="String" />
<asp:Parameter Name="answers" Type="String" />
<asp:Parameter DbType="Date" Name="doc" />
<asp:Parameter Name="roleid" Type="Int32" />
<asp:Parameter Name="userid" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="fullname" Type="String" />
<asp:Parameter Name="email" Type="String" />
<asp:Parameter Name="question" Type="String" />
<asp:Parameter Name="answers" Type="String" />
<asp:Parameter DbType="Date" Name="doc" />
<asp:Parameter Name="roleid" Type="Int32" />
</InsertParameters>
</asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:Waleed_orsfinalConnectionString5 %>"
DeleteCommand="DELETE FROM [tblUser] WHERE [userid] = @userid"
InsertCommand="INSERT INTO [tblUser] ([fullname], [email], [question], [answers], [doc], [roleid]) VALUES (@fullname, @email, @question, @answers, @doc, @roleid)"
SelectCommand="SELECT [userid], [fullname], [email], [question], [answers], [doc], [roleid],[active] FROM [tblUser] where fullname=@emplyrName AND roleid=2"
UpdateCommand="UPDATE [tblUser] SET [fullname] = @fullname, [email] = @email, [question] = @question, [answers] = @answers, [doc] = @doc, [roleid] = @roleid, [active]= @active WHERE [userid] = @userid">
<DeleteParameters>
<asp:Parameter Name="userid" Type="Int32" />
</DeleteParameters>
<UpdateParameters>
<asp:Parameter Name="fullname" Type="String" />
<asp:Parameter Name="email" Type="String" />
<asp:Parameter Name="question" Type="String" />
<asp:Parameter Name="answers" Type="String" />
<asp:Parameter DbType="Date" Name="doc" />
<asp:Parameter Name="roleid" Type="Int32" />
<asp:Parameter Name="active" Type="Boolean" />
<asp:Parameter Name="userid" Type="Int32" />
</UpdateParameters>
<InsertParameters>
<asp:Parameter Name="fullname" Type="String" />
<asp:Parameter Name="email" Type="String" />
<asp:Parameter Name="question" Type="String" />
<asp:Parameter Name="answers" Type="String" />
<asp:Parameter DbType="Date" Name="doc" />
<asp:Parameter Name="roleid" Type="Int32" />
<asp:Parameter Name="active" Type="Boolean" />
</InsertParameters>
<SelectParameters>
<asp:ControlParameter ControlID="txtboxEmplyrName" Name="emplyrName" Type="String" PropertyName="text" />
</SelectParameters>
</asp:SqlDataSource>
</div>
</asp:Content>