CS4 webControl25

CS4 webControl25

Contact25

Contact25 is a flexible address and contact entry control. It supports single or multiple addresses with optional fields such as district, mobile, GSTIN, Aadhar, and shipping/business modes.

Features

  • Single and multiple contact entry
  • Shipping & business address support
  • Optional address name and district
  • Auto-complete for district, state, and country
  • Dynamic add/remove rows
  • Model binding–friendly structure

Core Classes

Contact

Represents a single address record.

PropertyDescription
AddressLine1Primary address line (required)
AddressLine2Secondary address line
AddressLine3Additional address details
LandmarkNearby landmark
CityCity name
DistrictDistrict name
StateState name
CountryCountry name
ZipCodePostal code
MobileMobile number
AddressNameCustom address name (Home, Office, etc.)
AadharNoAadhar number (business mode)
GSTINGSTIN (business mode)
AddressIdHidden unique address ID

Properties Class

Contact25.Properties controls rendering behavior and data binding.

PropertyDescription
ControlIdHTML table ID
ModelIdModel prefix for form binding
ContactTypeSingle or Multiple
IsShippingPrefixes fields with Shipping (S)
IsBusinessShows Aadhar & GSTIN fields
ShowAddressNameDisplays address name column
ShowDistrictDisplays district column
ShowMobileDisplays mobile column
IsMobileRequiredMarks mobile as mandatory
IsAddressLine2RequiredMakes address line 2 mandatory
DistrictAutoCompleteUrlDistrict autocomplete API
StateAutoCompleteUrlState autocomplete API
CountryAutoCompleteUrlCountry autocomplete API
ContactsInitial list of contacts

Contact Types

public enum ContactType
{
    Single,
    Multiple
}

ingle Contact Usage

var props = new Contact25.Properties
{
    ContactType = Contact25.ContactType.Single
};

@Html.Raw(Contact25.GetHtml(props))

Multiple Contact Usage

var props = new Contact25.Properties
{
    ControlId = "AddressTable",
    ModelId = "Addresses",
    ContactType = Contact25.ContactType.Multiple,
    ShowDistrict = true,
    ShowMobile = true,
    IsBusiness = true,
    Contacts = new List
    {
        new Contact25.Contact()
    }
};

@Html.Raw(Contact25.GetHtml(props))

Auto-Complete Support

Auto-complete is enabled by providing URLs. Internally, the control calls AutoCompleteFunction() on keyup.

StateAutoCompleteUrl = "/AutoComplete/State",
DistrictAutoCompleteUrl = "/AutoComplete/District",
CountryAutoCompleteUrl = "/AutoComplete/Country"

Dynamic Row Operations

  • Add Row: Uses addRow()
  • Delete Row: Uses deleteRow()

These JavaScript helpers dynamically clone and bind fields while preserving model indexing.