Graphic web design - to its SelectedIndexChanged event handler. Then type in
to its SelectedIndexChanged event handler. Then type in the necessary code to populate each Textbox control. So the whole C# procedure looks like this: //Populate Textbox controls with selected user s profile properties. protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) { txtFirstName.Text = Profile.GetProfile(DropDownList1.SelectedValue).FirstName; txtLastName.Text = Profile.GetProfile(DropDownList1.SelectedValue).LastName; txtAddress1.Text = Profile.GetProfile(DropDownList1.SelectedValue).Address1; txtAddress2.Text = Profile.GetProfile(DropDownList1.SelectedValue).Address2; txtCity.Text = Profile.GetProfile(DropDownList1.SelectedValue).City; txtStateProv.Text = Profile.GetProfile(DropDownList1.SelectedValue).StateProvince; txtZIPpostal.Text = Profile.GetProfile(DropDownList1.SelectedValue).ZIPPostalCode; txtCountry.Text = Profile.GetProfile(DropDownList1.SelectedValue).Country; txtPrefTheme.Text = Profile.GetProfile(DropDownList1.SelectedValue).PreferredTheme; } To allow editing you d need to include a button like the Submit button in the EditProfile.aspx page from Chapter 9. But, again, replace Profile. with Profile. GetProfile(DropDownList1.SelectedValue). as shown here: //Replace current user s profile properties with contents of Textbox controls. protected void Button1_Click(object sender, EventArgs e) { Profile.GetProfile(DropDownList1.SelectedValue).FirstName = txtFirstName.Text; Profile.GetProfile(DropDownList1.SelectedValue).LastName = txtLastName.Text; Profile.GetProfile(DropDownList1.SelectedValue).Address1 = txtAddress1.Text; Profile.GetProfile(DropDownList1.SelectedValue).Address2 = txtAddress2.Text; Profile.GetProfile(DropDownList1.SelectedValue).City = txtCity.Text; Profile.GetProfile(DropDownList1.SelectedValue).StateProvince = txtStateProv.Text; Profile.GetProfile(DropDownList1.SelectedValue).ZIPPostalCode = txtZIPpostal.Text; Profile.GetProfile(DropDownList1.SelectedValue).Country = txtCountry.Text; Profile.GetProfile(DropDownList1.SelectedValue).PreferredTheme = txtPrefTheme.Text; } Assuming you add that to the previous page example, when you choose a user from the drop-down menu, that page shows all profile properties for that user as well as all of that user s transactions, as shown in Figure 12-27. 286 Part III: Personalization and Databases
If you are looking for cheap and quality webhost to host and run your website check Jboss Web Hosting services.