Guides (SDK /API)Technical ReferenceBBDNHow-to Documentation

You are here: Custom Parts Example: Constituent Search > Change the Top Label Based on Selected Constituency

Change the Top Label Based on Selected Constituency

Code sample project: Custom Individual (Blackbaud CRM Constituent) Search

To change a label based on the part's content properties, in the display form code (CustomSearchFormDisplay.ascx.vb), add this for the page load:

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If MyContent.Constituency = "All" Then
            LabelConstituency.Text = "Individual Search"
        Else
            LabelConstituency.Text = "Individual Search: " + MyContent.Constituency + " constituency"
        End If
    End Sub

mContent is an instance of a properties class called CustomSearchFormProperties, which is a part of the project.

Public Class CustomSearchFormProperties
    Public Constituency As String
    Public ConstituencyID As System.Guid
    Public SearchAll As Boolean
End Class