SourceCode

Topics: ASP.NET 2.0, Business Logic Layer, Controls
Feb 27, 2009 at 6:05 PM
Hello,
I have downloaded the BlogEngine source and web files.
I got everything running quickly, and even converted to MS SQL Server 2005 very quickly. However I have had problems with the source code. When I open the top level project, the BlogEngine.Web project will not load (I do not find any solution or project files in this directory).
Also, I just want to make a simple change to the text on the login page, but cannot find what is powering it.
I have searched through the .Core and .Web files, I have done searches on text on the "page" such as the "Remember Me...". When I look at the actual Login.aspx page, I see it is invoking some type of control, but I cannot find it.

Does anyone have experience modifying the source code.
I do a lot of .net but I don't know everything about .net nor all of the various ways to setup projects and/or develop with .net.

Any help appreciated.
Coordinator
Feb 27, 2009 at 7:17 PM
There should be a solution file in the source download.  If you downloaded BE 1.4.5, then the solution file name to open in Visual Studio would be "BlogEngine.NET 1.4.5.sln".  When you open that solution, there should be 2 projects in the solution -- the core project and the web project.

The login page comes from login.aspx and login.aspx.cs in the main web project.  The username, password, Remember me next time checkbox and Log In button come from the <asp:Login> control which automatically outputs these controls.  The login control can be customized.  For instance, if you want to remove the 'Remember me next time' checkbox, you can set the DisplayRememberMe attribute of the login control to false ... I.E.

<asp:Login ID="Login1" runat="server" class="loginbox" DisplayRememberMe="false" />
Feb 28, 2009 at 5:41 AM
BenAmada,
Thank you for the reply.
I have downloaded the source download and opened the solution file, when it loads it states that it cannot load the BlogEngine.Web project.

For the Login Control, where is the code that creates/populates the control? For example, what if i want to change what the Remember me line says? What if I want to add something to it?
Coordinator
Feb 28, 2009 at 6:39 PM
For opening the solution in VS, instead of opening the SLN file, you could try opening up the BlogEngine.Core.csproj file in the DotNetSlave.BusinessLogic folder.  It could make a difference.

The login control is something that's built into .NET -- it's not BE specific.  But you can still customize the login control.  This article does just that.
Mar 27, 2009 at 11:10 PM
Ultra newbie and sorry for probably dumb questions...

Can you explain the generic difference between the Web and Core folders?

I only have the Web in my VS 2008 Projects dir and the blog site runs. I'm assuming that is due to the bin dirs having the full compiled solution from the download. If I wanted to build/compile the site from scratch, where do I place the Core dir in relation to the Web dir in VS2008 and what else should I do before compiling in VS?

Thanks.
Coordinator
Mar 28, 2009 at 12:18 AM
So, yes, the Core is compiled into the BlogEngine.Core.dll file in your BIN directory.  The core contains most of the business logic, data access code, etc.

If you were to download the source code version of BE, it'll include a solution file (SLN) in addition to the core and web folders.  If you open the SLN file in Visual Studio, it should contain two projects -- the core project and the web project.  Within this solution, the web folder is already setup so it's referencing the core project.  So when you update the core and compile it, the DLL in the web project's BIN folder will get automatically updated.  You can see this reference to the core by right-clicking on the web project, Properties, and on the References tab, it'll have a reference to BlogEngine.Core ... with a Type of "Project" and the Version is "Auto Update".

You could also create your own solution file and add the core project and the web project into the solution.  You can then add the reference in the web project to the core project.
Mar 28, 2009 at 6:31 PM
Thanks. What you stated worked great. This is a great product!