Google Search Widget For BlogEngine.Net



TODO:

Do you want to have a google search widget for BlogEngine.Net?  

 

SOLUTION:

Download the GoogleSearch.rar file below.  Create a directory for it in the widgets folder which is located under the root.  Unzip all files to that folder.  Now when you look at your page, you can add the widget to your pages.

 

NOTES:

There are no notes on this topic

GoogleSearch.rar (3.05 kb)

How To Remove "Log In" link from BlogEngine.Net Sites



TODO:

Have you ever wanted to get rid of the "log in" link that appears on sites created with BlogEngine.Net?

 

SOLUTION:

1.  Edit the PageMenu.cs page that is located in BlogEngine.Net\App_Code\Controls\PageMenu.cs

2.  Chagne the BindPages() method to be the code below.

3.  Build BlogEngine.Net, and copy the DLLs to your "bin" folder.

 

private HtmlGenericControl BindPages()
{
            // recursivly get all children of the root page
            HtmlGenericControl ul = GetChildren(Guid.Empty);

            // items that will be appended to the end of menu list
            AddMenuItem(ul, Contact, "~/contact.aspx");

            if (Security.IsAuthenticated)
            {
                AddMenuItem(ul, Logoff, "~/Account/login.aspx?logoff");
            }
            else
            {
                //AddMenuItem(ul, Logon, "~/Account/login.aspx");
            }

            return ul;
}

 

 

NOTES:

All I did was comment out the else so that "log in" never appears.  If you navigate to http://site/account/login.aspx, you can log in.  In the event you do log in, you will get a "log out" link, but will never get the "log in" link.

How To Pass A Parameter To A Custom User Control In BlogEngine.net 2.5



TODO:

Have you ever wanted to use a Custom Control in BlogEngine.net, and also pass a parameter to that UserControl?

 

SOLUTION:

Create a Page or Post, and put the following line right into the editor.

 

ERROR - UNABLE TO LOAD CONTROL : ~/User Controls/MyGallery.ascx ImageDir=/blah/blah; MyOtherProp=blah;

 

 

NOTES:

The example above loads the MyGallery.ascx control from the "User Controls" directory, and set the properties on the UserControl named "ImageDir" and "MyOtherProp".

The above example assumes you have created the properties "ImageDir" and "MyOtherProp" on your UserControl.