This project is read-only.

Blogengine 2.5 Garland Revisited Newsletter broke

Topics: Themes
Jan 12, 2012 at 10:51 PM

HI,

Can someone confirm if signing up for the newsletter functionality in the Razor Garland Revisited Newsletter is broke or is it my installation? I have spent all day on this with no luck, it seems that the validators for the email textbox are not getting rendered. Any suggestions?

Thanks

J.

Jan 14, 2012 at 3:32 AM

The newsletter widget with a Razor theme may not work... at least one other person has brought this up.  Three possible solutions I can think of.

#1 - Code changes for the Razor host page that would attempt to inject the ASP.NET validation scripts into the page.

#2 - Change the Newsletter widget so it doesn't rely on the ASP.NET validation and callback system (i.e. switch to a standard AJAX call and manually validate the input via JavaScript not tied to the ASP.NET validation system).

#3 - Create a Razor version of the Newsletter widget.  Or modify the existing Newsletter widget so it is able to dynamically choose between the non-Razor version and the Razor version based on whether the theme is a Razor theme.

Aug 30, 2012 at 7:16 PM

So I guess none of the 3 solutions has been done yet?

I just installed this week and was trying to figure this out too. 

 

Phil

Jan 14, 2014 at 1:52 PM
Hi

Someone has been able to use newsletter on the razor theme?

Is there a solution? There is a project to solve this problem in the future or not?

A blog is not a blog without newsletter..

Thankss

Fabry
Jan 15, 2014 at 3:55 PM
I think that this problem does not concern only razor, but most themes, as figured here https://blogengine.codeplex.com/discussions/431793
Hope that a team developer could find a solution.
Jan 15, 2014 at 5:10 PM
Edited Jan 15, 2014 at 6:04 PM
In non razor themes, this seems to work(at least locally).

Slight change to OnInit in page.aspx.cs
protected override void OnInit(EventArgs e)
    {
        var queryString = this.Request.QueryString;
        var qsDeletePage = queryString["deletepage"];
        if (qsDeletePage != null && qsDeletePage.Length == 36)
        {
            this.DeletePage(new Guid(qsDeletePage));
        }

        Guid id = GetPageId();
        if (id != Guid.Empty)
        {
            this.ServePage(id);
            this.AddMetaTags();
        }
        else
        {
            if (!this.IsCallback) // Check added
            {
                this.Response.Redirect(Utils.RelativeWebRoot);
            }
        }

        base.OnInit(e);
    }    
It doesn't however, work on the home page if the home page is set to a BE page.

Edit: Replaced the above code, just realised I pasted in test code.
Jan 16, 2014 at 2:19 AM
With 2.9.0.9 it should work in front page.

No Razor solution yet, will probably have to go with web api instead of callbacks for that.