<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
protected void Button1_Click(object sender, System.EventArgs e)
{
// set your own datetime which you need.
DateTime myDate = DateTime.Now;
GridView1.DataSource = ProfileManager.FindInactiveProfilesByUserName(ProfileAuthenticationOption.Authenticated,TextBox1.Text,myDate);
GridView1.DataBind();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title>How to find inactive profiles by user name in asp.net</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2 style="color:Green">asp.net profile example<br />Find Inactive Profiles By User Name</h2>
<asp:GridView
ID="GridView1"
runat="server"
AutoGenerateColumns="true"
AllowPaging="true"
BackColor="RosyBrown"
ForeColor="SaddleBrown"
HeaderStyle-BackColor="SaddleBrown"
HeaderStyle-Font-Italic="false"
HeaderStyle-ForeColor="RosyBrown"
BorderColor="SaddleBrown"
GridLines="Horizontal"
Font-Italic="true"
>
</asp:GridView>
<br />
<asp:Label
ID="Label1"
runat="server"
Font-Bold="true"
ForeColor="SeaGreen"
Text="User Name"
>
</asp:Label>
<asp:TextBox
ID="TextBox1"
runat="server"
BackColor="SeaGreen"
ForeColor="AliceBlue"
>
</asp:TextBox>
<br />
<asp:Button
ID="Button1"
runat="server"
Font-Bold="true"
ForeColor="SeaGreen"
Text="Find Inactive Profiles"
OnClick="Button1_Click"
/>
</div>
</form>
</body>
</html>
No comments:
Post a Comment