Author: ldechent | Posted on: 12/20/2008 5:27:14 PM | Views : 277

I have a code segment (in C#) that is used in several files.

  MembershipUser membershipUser = Membership.GetUser();
if (membershipUser != null)
{
ViewState["username"] = Membership.GetUser().ToString();
}
else
{
Response.Redirect("Login2.aspx");
}
What is the best way to store it in one place and use it over again and again (I'm assuming something that is a one liner that will refer to all of the above).

-Larry
...

Go to the complete details ...