Prev | Current Page 583 | Next

Rob Cameron and Dale Michalk

"Pro ASP.NET 3.5 Server Controls and AJAX Components"

DisplayMode = mode;
}
#endregion
}
}
Now that we have good control over the web part page functionality, we next take care of
a little bit of code cleanup to make the web parts look better before moving on to discuss how
to enable connections between web parts.
Connecting Web Parts
In the previous sections, we created server controls and then converted them to web parts. We
also added a handy web page controller web part to expose web part page functionality to end
users. In the server control versions of the web parts, we added a border and a label to contain
a title for the control. If you view the screen shots in Figures 10-1 to 10-4, you see that the
CustomerListWebPart control has the title set to Customer List, resulting in the phrase ???Customer
List??? appearing twice. The CustomerInvoicesWebPart has a title of Untitled. Web parts include
their own border and title functionality, so we first need to remove the blue border functionality
from the server controls. Next, we??™ll start the work on connecting the web parts.
First, we create an interface for passing the customer ID from the CustomerListWebPart to
the CustomerInvoicesWebPart called ICustomerID. We add the [Personalizable()] attribute
to the CustomerID property on the CustomerListWebPart control so that the value of CustomerID
is saved as part of the persistence service and will be available the next time the page is loaded.


Pages:
571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595