/// <summary>
    /// Page load event.
    /// </summary>
    /// <param name="sender">Sender</param>
    /// <param name="e">Arguments</param>
    protected void Page_Load(object sender, EventArgs e)
    {
        // Setup page title text and image
        PageTitle.TitleText = GetString("license.export");

        // Initialize breadcrumbs
        PageBreadcrumbs.Items.Add(new BreadcrumbItem
        {
            Text        = GetString("Licenses_License_New.Licenses"),
            RedirectUrl = UIContextHelper.GetElementUrl("Licenses", "Licenses", false),
        });
        PageBreadcrumbs.Items.Add(new BreadcrumbItem
        {
            Text = GetString("license.export"),
        });

        // Resource strings
        rfvFileName.ErrorMessage = GetString("license.export.filenameempty");

        // Default file name
        if (!RequestHelper.IsPostBack())
        {
            ShowInformation(GetString("license.export.info"));
            txtFileName.Text = ImportExportHelper.GenerateExportFileName("list_of_domains", ".txt");
        }
    }
    /// <summary>
    /// Ensure user friendly file name
    /// </summary>
    /// <param name="infoObj">Object to be exported</param>
    /// <param name="backup">Indicates if export is treated as backup</param>
    private static string GetExportFileName(GeneralizedInfo infoObj, bool backup)
    {
        string prefix;

        // Get file name according to accessible object properties
        var ti = infoObj.TypeInfo;

        if (ti.CodeNameColumn != ObjectTypeInfo.COLUMN_NAME_UNKNOWN)
        {
            prefix = infoObj.ObjectCodeName;
        }
        else
        {
            string identifier = (ti.DisplayNameColumn != ObjectTypeInfo.COLUMN_NAME_UNKNOWN) ? infoObj.ObjectDisplayName : infoObj.ObjectGUID.ToString();

            prefix = ValidationHelper.GetCodeName(identifier);
        }

        // Backup use short file name, in other cases use long file name with object type
        if (!backup)
        {
            string objectType = ti.IsListingObjectTypeInfo ? ti.OriginalObjectType : ti.ObjectType;

            prefix = objectType + "_" + prefix;
        }

        return(ImportExportHelper.GenerateExportFileName(prefix.Replace(".", "_")));
    }
 public void InitControl()
 {
     if (String.IsNullOrEmpty(txtFileName.Text))
     {
         txtFileName.Text = ImportExportHelper.GenerateExportFileName("export");
     }
 }