Home Assigning DefaultValue in ASP.NET for SelectParameters
 I'm trying to assign default value to the user that are currently login, for them to view their profile. Here is the datasource:   Here is my code behind:  public partial class ProfilePage : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { SqlDataProfile.SelectParameters["username"].DefaultValue =User.Identity.Name; }  When I set the default value into existing username as below, it totally works but doesn't work with the code above.