Addresses
Tags, loops and code examples available for user address editing in User Management
Available tags
UserManagement:User.ManageAddresses.AddAddress.Javascript
Returns a script with an add address function similar to this:
<script>function addAddress(){document.getElementById('ManageAddressesFormAction').value = 'Add';document.getElementById('UserManagementManageAddressesForm').submit();}</script>
@GetString("UserManagement:User.ManageAddresses.AddAddress.Javascript")
UserManagement:User.ManageAddresses.DeleteAddress.Javascript
Returns a script with a delete address function similar to this:
<script>function deleteAddress(addressId){if(document.getElementById('UserId').value == addressId){alert('Main address can not be deleted.');return;}else if (document.getElementById('DefaultAddressId').value == addressId){alert('You can’t delete a default address. Set another address as default before delete this address.');return;}else if(confirm('Delete address?')){document.getElementById('SelectedAddressId').value = addressId;document.getElementById('ManageAddressesFormAction').value = 'Delete';document.getElementById('UserManagementManageAddressesForm').submit();}}</script>
@GetString("UserManagement:User.ManageAddresses.DeleteAddress.Javascript")
UserManagement:User.ManageAddresses.FormEnd
Returns the end tag for the form </form> that is used to manage the addresses.
@GetString("UserManagement:User.ManageAddresses.FormEnd")
UserManagement:User.ManageAddresses.FormStart
Returns the code snippet for the form start for the form that is used to manage the addresses:
<form name="UserManagementManageAddressesForm" id="UserManagementManageAddressesForm" action="http://yourwebsite.dk/Default.aspx?ID=14867&ObjectID=265&Action=ManageAddresses" method="post"><input type="hidden" id="ManageAddressesFormAction" name="ManageAddressesFormAction" value="" /><input type="hidden" id="SelectedAddressId" name="SelectedAddressId" value="" /><input type="hidden" id="UserId" name="UserId" value="265" /><input type="hidden" id="DefaultAddressId" name="DefaultAddressId" value="5" />
@GetString("UserManagement:User.ManageAddresses.FormStart")
UserManagement:User.ManageAddresses.MakeDefault.Javascript
Returns a script with a function that is used to mark an address as default.
<script>function makeDefaultAddress(addressId){document.getElementById('SelectedAddressId').value = addressId;document.getElementById('ManageAddressesFormAction').value = 'MakeDefault';document.getElementById('UserManagementManageAddressesForm').submit();}</script>
@GetString("UserManagement:User.ManageAddresses.MakeDefault.Javascript")
UserManagement:User.ManageAddresses.UpdateAddress.Javascript
Returns a script with an update address function similar to this:
<script>function updateAddress(addressId){document.getElementById('SelectedAddressId').value = addressId;document.getElementById('ManageAddressesFormAction').value = 'Update';document.getElementById('UserManagementManageAddressesForm').submit();}</script>
@GetString("UserManagement:User.ManageAddresses.UpdateAddress.Javascript")
Available loops
UserManagement:User.UserAddresses
The UserManagement:User.UserAddresses loop lets you display various information about the user addresses.
@foreach (LoopItem item in GetLoop("UserManagement:User.UserAddresses")){ <p>@item.GetValue("TagName")</p> }