Feature Request (Split Markup and Script generation)

Jan 23, 2013 at 1:39 AM

It would be awesome if it were possible to split the markup from the JavaScript generation, to support providing script at the bottom of the page. We currently load all scripts as close to the body closing tag as possible. Unfortunately this does not work with the component as it requires jquery to be before the use of @Html.Captcha(..).

How about something like this:
<html><body>@Html.CaptchaMarkup(...)<!--jquery and other scripts go here-->@Html.CaptchaScript(...)</body></html>

Awesome library!

Coordinator
Jan 23, 2013 at 2:37 PM

Hi,

Thank you for your feedback.

Soon I'll add interface to represent captcha, it would look like this:

    /// <summary>
    ///     Represents the captcha model.
    /// </summary>
    public interface ICaptcha : IHtmlString
    {
        /// <summary>
        ///     Renders only captcha markup, if any.
        /// </summary>
        /// <returns>
        ///     An instance of <see cref="IHtmlString" />.
        /// </returns>
        IHtmlString RenderMarkup();

        /// <summary>
        ///     Renders only captcha scripts, if any.
        /// </summary>
        /// <returns>
        ///     An instance of <see cref="IHtmlString" />.
        /// </returns>
        IHtmlString RenderScript();
    }

 By default it renders full captcha, but if you want render only markup you can do this. In a new version will be a lot of new features.

Regards,
Vyacheslav Volkov