Add another Field

Topics: ASP.NET 2.0, Business Logic Layer, Controls, Themes
Jun 16, 2011 at 8:29 PM

Hi Guys and Girls,

Firstly let me say thank you for blogengine! Its awesome.

Let me say that I am quite new to coding and I dont know if what I want to do is possible. I have played around with SQL Database and getting/inserting etc from them but this XML malartky looks complicated!

1. Basically, when I create a post I want to assign a percentage 1%-100% and save this in the xml file...... thats the first quandry...... I know how to add a text box or drop down list to the page.... but how to get the result from there saved into the XML file?

2.  when the post is retrieved I want to pull this data from the XML file aswell.

3. I then want this information in the code behind because I then want to display an image in the post based on the number....  (this bit i might be able to work out.... but the prior two steps not sure about).....

Finally, anyone able to tell me of any good sites, or books to read about working with  / saving xml and retrieving it?




Jun 17, 2011 at 12:39 AM
Edited Oct 24, 2011 at 6:55 PM

With BlogEngine you really don't need to work directly with the xml.


BlogEngine loads everything in to the app_pool and then you can edit, and etc with it with BE objects  and then save it to xml.

BE uses LINQ to work the Objects.




            using (var writer = XmlWriter.Create(fileName, settings))
                writer.WriteStartElement("page");   <--- Root Element

                writer.WriteElementString("pagename", page.PageName);   <--- Writes  Value of page.PageName into 
				                                                             the element <PageName>
				 PageName = doc.SelectSingleNode("page/pagename").InnerText, <--- Selects the Element <PageName>
				 this.txtPageName.Text = page.PageName;  <--- Gets the value from the textbox

Java Blog

Jun 17, 2011 at 12:49 AM
Edited Jun 17, 2011 at 1:03 AM

Basically, when I create a post I want to assign a percentage 1%-100% and save this in the xml file


Do you want a "Field" in the post for "Percentage" ?


If so these are the files you need to change:

Post.cs  <--- BlogEngineDotSlave  Business Logic

Posts.cs  <---   In the Providers --> XML Provider

ajaxhelper.aspx.cs  <--  Admin

Globalresource file  <-- Root

EditPost.aspx     <----    Admin-->Posts

EditPost.aspx.cs  <----    Admin-->Posts


Very easy to do, just a few lines of code for each file just modify the code thats already there.


Doing it this way adds it to the app_pool  and you can then access it through objects and not the xml


Then in code behind :

if post.percentage = "a number you want" then


Code you want it to preform.



Thats it :)

Jun 19, 2011 at 5:49 AM
Edited Jun 19, 2011 at 5:55 AM

Here another useful links:

Jun 28, 2011 at 4:19 PM

is this a built-in feature in BE 2.5?