How could I get a default depending if the user is logged in or not?
public class ShippingDetails {
public ShippingDetails() {
if (HttpContext.Current.User.Identity.Name != "") {
Name = "";
}
}
public string Name { get; set; }
}
You mean get the users login name, otherwise just give them a dummy name? Check if they’re logged in using
Request.IsAuthenticated. If they are, grab the username, if not just set it.