Webiant Logo Webiant Logo
  1. No results found.

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

IWebHelper.cs

using Microsoft.AspNetCore.Http;

namespace Nop.Core;

/// 
/// Represents a web helper
/// 
public partial interface IWebHelper
{
    /// 
    /// Get URL referrer if exists
    /// 
    /// URL referrer
    string GetUrlReferrer();

    /// 
    /// Get IP address from HTTP context
    /// 
    /// String of IP address
    string GetCurrentIpAddress();

    /// 
    /// Gets this page URL
    /// 
    /// Value indicating whether to include query strings
    /// Value indicating whether to get SSL secured page URL. Pass null to determine automatically
    /// Value indicating whether to lowercase URL
    /// Page URL
    string GetThisPageUrl(bool includeQueryString, bool? useSsl = null, bool lowercaseUrl = false);

    /// 
    /// Gets a value indicating whether current connection is secured
    /// 
    /// True if it's secured, otherwise false
    bool IsCurrentConnectionSecured();

    /// 
    /// Gets store host location
    /// 
    /// Whether to get SSL secured URL
    /// Store host location
    string GetStoreHost(bool useSsl);

    /// 
    /// Gets store location
    /// 
    /// Whether to get SSL secured URL; pass null to determine automatically
    /// Store location
    string GetStoreLocation(bool? useSsl = null);

    /// 
    /// Returns true if the requested resource is one of the typical resources that needn't be processed by the CMS engine.
    /// 
    /// True if the request targets a static resource file.
    bool IsStaticResource();

    /// 
    /// Modify query string of the URL
    /// 
    /// Url to modify
    /// Query parameter key to add
    /// Query parameter values to add
    /// New URL with passed query parameter
    string ModifyQueryString(string url, string key, params string[] values);

    /// 
    /// Remove query parameter from the URL
    /// 
    /// Url to modify
    /// Query parameter key to remove
    /// Query parameter value to remove; pass null to remove all query parameters with the specified key
    /// New URL without passed query parameter
    string RemoveQueryString(string url, string key, string value = null);

    /// 
    /// Gets query string value by name
    /// 
    /// Returned value type
    /// Query parameter name
    /// Query string value
    T QueryString(string name);

    /// 
    /// Restart application domain
    /// 
    void RestartAppDomain();

    /// 
    /// Gets a value that indicates whether the client is being redirected to a new location
    /// 
    bool IsRequestBeingRedirected { get; }

    /// 
    /// Gets or sets a value that indicates whether the client is being redirected to a new location using POST
    /// 
    bool IsPostBeingDone { get; set; }

    /// 
    /// Gets current HTTP request protocol
    /// 
    string GetCurrentRequestProtocol();

    /// 
    /// Gets whether the specified HTTP request URI references the local host.
    /// 
    /// HTTP request
    /// True, if HTTP request URI references to the local host
    bool IsLocalRequest(HttpRequest req);

    /// 
    /// Get the raw path and full query of request
    /// 
    /// HTTP request
    /// Raw URL
    string GetRawUrl(HttpRequest request);

    /// 
    /// Gets whether the request is made with AJAX 
    /// 
    /// HTTP request
    /// Result
    bool IsAjaxRequest(HttpRequest request);
}