UserManagement:User.ManageAddresses.DeleteAddress.Javascript

Version: - string  

Summary

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>

Settings

The value is generated automatically.

Examples

Outputting the template tag

@GetString("UserManagement:User.ManageAddresses.DeleteAddress.Javascript")

Check if tag has a value

@if(!string.IsNullOrWhiteSpace(GetString("UserManagement:User.ManageAddresses.DeleteAddress.Javascript"))) { @* Tag has value, so let's do something useful here. *@ }

Assign tag to a value for later use

@{ string storedTag = GetString("UserManagement:User.ManageAddresses.DeleteAddress.Javascript"); }

Outputting the template tag

<!--@UserManagement:User.ManageAddresses.DeleteAddress.Javascript-->

Check if string has a value

<!--@If Defined(@UserManagement:User.ManageAddresses.DeleteAddress.Javascript)--> Let's output this tag here: <strong><!--@UserManagement:User.ManageAddresses.DeleteAddress.Javascript--></strong> <!--@EndIf(@UserManagement:User.ManageAddresses.DeleteAddress.Javascript)-->