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.
| Property | Description |
| AddressLine1 | Primary address line (required) |
| AddressLine2 | Secondary address line |
| AddressLine3 | Additional address details |
| Landmark | Nearby landmark |
| City | City name |
| District | District name |
| State | State name |
| Country | Country name |
| ZipCode | Postal code |
| Mobile | Mobile number |
| AddressName | Custom address name (Home, Office, etc.) |
| AadharNo | Aadhar number (business mode) |
| GSTIN | GSTIN (business mode) |
| AddressId | Hidden unique address ID |
Properties Class
Contact25.Properties controls rendering behavior and data binding.
| Property | Description |
| ControlId | HTML table ID |
| ModelId | Model prefix for form binding |
| ContactType | Single or Multiple |
| IsShipping | Prefixes fields with Shipping (S) |
| IsBusiness | Shows Aadhar & GSTIN fields |
| ShowAddressName | Displays address name column |
| ShowDistrict | Displays district column |
| ShowMobile | Displays mobile column |
| IsMobileRequired | Marks mobile as mandatory |
| IsAddressLine2Required | Makes address line 2 mandatory |
| DistrictAutoCompleteUrl | District autocomplete API |
| StateAutoCompleteUrl | State autocomplete API |
| CountryAutoCompleteUrl | Country autocomplete API |
| Contacts | Initial 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.