Display Date Formate and User Name with Login Control

15 Sep

if you want to display date in this formate then use this code

lblDate.Text = DateTime.Now.ToString(“ddd”) + ‘ ‘ + DateTime.Now.Day.ToString() + ‘ ‘ + DateTime.Now.ToString(“MMMM”) + ‘ ‘ + DateTime.Now.Year.ToString();

you you want to display full day then just


Login Control

write this code at master page.

if (HttpContext.Current.User.Identity.IsAuthenticated == true)

tvLeftNav.Visible = true;
loginImg.Visible = true;
tvLeftNav.Visible = false;

For display at Each Page top where user login then this code write at master page

<asp:loginview ID=”LoginView1″ runat=”server”>

<asp:loginname id=”LoginName1″ runat=”server” formatstring=”{0}” />



For Logout

<asp:LoginStatus ID=”LoginStatus2″ runat=”server”
LogoutAction=”RedirectToLoginPage” LogoutPageUrl=”~/login.aspx” LogoutImageUrl=”~/images/12_icon.png” LoginImageUrl=”~/images/12_icon.png” />


Leave a comment

Posted by on September 15, 2010 in ASP Dot Net C#


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: