Shared web hosting - To see the properties of some other user,

To see the properties of some other user, use the following syntax instead: Profile.GetProfile(UserName).propertyName where UserName is the name of the user for which you want to view a profile, and propertyName is the name of the property. If the UserName value is stored in a control, like DropDownList1, then UserName is actually the value of that control, as given here: Profile.GetProfile(DropDownList1.SelectedValue).propertyName So, if the name Bob is currently selected in the control named DropDownList1, then Profile.GetProfile(DropDownList1.SelectedValue).FirstName refers to user Bob s LastName property. Given that, you could add a table to the page that contains a Textbox control for each profile property you want to display. For example, Figure 12-26 shows some Textbox controls, and their names, in a page with a drop-down list control on it. I ve also pointed out the names of the drop-down list control (DropDownList1) and the button (Button1), as those names are important programmatically. Each time you choose a name from the drop-down list, the Textbox controls need to be populated with properties from the currently-selected user, which means they have to be updated every time the value in the drop-down list changes. To make that happen, double-click the drop-down list control to get Button1 txtPrefTheme txtZIPpostal txtStateProv txtCity txtAddress2 txtAddress1 txtLastName txtFirstName Figure 12-26: Textbox controls that can be used to show profile properties. Chapter 12: Using Data in Web Pages 285
We recommend cheap and reliable webhost to host and run your web applications: Coldfusion Web Hosting services.

Leave a Reply