Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

HtmlExtensions.cs

using System.Text;
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.Rendering;
using Nop.Core.Domain.Security;
using Nop.Core.Infrastructure;

namespace Nop.Web.Framework.Security.Honeypot;

/// 
/// HTML extensions
/// 
public static class HtmlExtensions
{
    /// 
    /// Generate honeypot input
    /// 
    /// HTML helper
    /// Result
    public static IHtmlContent GenerateHoneypotInput(this IHtmlHelper helper)
    {
        var sb = new StringBuilder();

        sb.AppendFormat("
"); sb.Append(Environment.NewLine); var securitySettings = EngineContext.Current.Resolve(); sb.AppendFormat("", securitySettings.HoneypotInputName); sb.Append(Environment.NewLine); sb.Append("
"); return new HtmlString(sb.ToString()); } }