Problem adding first entry (post)

Sep 8, 2009 at 9:27 AM
Edited Sep 8, 2009 at 9:45 AM

I am used to Wordpress, and are now new to BlogEngine.NET - I have a problem with adding my first entry/post. The system seems to Require the following before it will allow me to add the post: "Upload image", "Upload file", and  it wants me to Add "Categories", before accepting the post.

I do not wish to upload image, upload file or add a category, just add the entry/post.

How do I get BlogEngine.NET to accept my entry/post?

PS. The same problem applies to when I try to add a Page to the blog.

Coordinator
Sep 8, 2009 at 9:45 AM

What version of BE?  What browser are you using?

I've not seen that before.  The Image should only be required if you click the 'Upload' button next to the Upload Image field.  Same with Upload file.  And Category should only be required if the 'Add' button is clicked.

Are you clicking the 'Save post' button in the bottom right to save your post?

Sep 8, 2009 at 9:51 AM

BE version: 1.5.0.7

Browser: Chrome 2.0.172.43

>> Are you clicking the 'Save post' button in the bottom right to save your post?

Yes, I do. Also tried now with IE7, resulting in the same problem.

Sep 8, 2009 at 9:56 AM

I have made a partial screenprint showing the problem. Can I send it somewhere? Can not seem to "insert" the image into this post.

Coordinator
Sep 8, 2009 at 9:58 AM

I've not used it before, but you should be able to post an image on photobucket for free.

http://photobucket.com/

 

Sep 8, 2009 at 11:05 AM

I used www.dropfiles.net instead. Please see if you can access the image here:

http://www.dropfiles.net//files/1704/BlogEngine_error.jpg

Coordinator
Sep 8, 2009 at 9:23 PM

This may or may not make a difference (it should be a solution).  But try replacing the contents of Add_entry.aspx in the admin\Pages folder with the content below.


<%@ Page Language="C#" MasterPageFile="~/admin/admin1.master" AutoEventWireup="true" CodeFile="Add_entry.aspx.cs" Inherits="admin_entry" ValidateRequest="False" EnableSessionState="True" %>
<%@ Register Src="../htmlEditor.ascx" TagPrefix="Blog" TagName="TextEditor" %>
<%@ Import Namespace="BlogEngine.Core" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphAdmin" Runat="Server">

<div id="tagselector" style="display: none">
    <a href="javascript:void(ToggleTagSelector())" style="color:Black;float:right">Close</a>
    <div style="clear:both"></div>
    <asp:PlaceHolder runat="server" ID="phTags" />
    <div style="clear:both"></div>
  </div>
 
<script type="text/javascript">
function ToggleVisibility()
{
  var element = document.getElementById('<%=ulDrafts.ClientID%>');
  if (element.style.display == "none")
    element.style.display = "block";
  else
    element.style.display = "none";
}

function GetSlug()
{
  var title = document.getElementById('<%=txtTitle.ClientID %>').value;
  WebForm_DoCallback('__Page', title, ApplySlug, 'slug', null, false)
}

function ApplySlug(arg, context)
{
  var slug = document.getElementById('<%=txtSlug.ClientID %>');
  slug.value = arg;
}

function AutoSave()
{
    var content = document.getElementById('<%=txtRawContent.ClientID %>') != null ? document.getElementById('<%=txtRawContent.ClientID %>').value : tinyMCE.activeEditor.getContent();
  var title = document.getElementById('<%=txtTitle.ClientID %>').value;
  var desc = document.getElementById('<%=txtDescription.ClientID %>').value;
  var slug = document.getElementById('<%=txtSlug.ClientID %>').value;
  var tags = document.getElementById('<%=txtTags.ClientID %>').value;
  var s = ';|;';
  var post = content + s + title + s + desc + s + slug + s + tags;
 
  if (content.length > 10)
  {
    WebForm_DoCallback('__Page', '_autosave' + post, null, 'autosave', null, false);
  }
 
  setTimeout("AutoSave()", 5000);
}

document.body.onkeypress = ESCclose;

function ESCclose(evt)
{
  if (!evt)
    evt = window.event;
    
  if (evt.keyCode == 27)
    document.getElementById('tagselector').style.display = 'none';  
 }

function AddTag(element)
{
  var input = document.getElementById('<%=txtTags.ClientID %>');  
  input.value += element.innerHTML + ', ';
}

function ToggleTagSelector()
{
  var element = document.getElementById('tagselector');
  if (element.style.display == "none")
    element.style.display = "block";
  else
    element.style.display = "none";
}
</script>

  <div id="divDrafts" runat="server" visible="False" enableviewstate="False" style="margin-bottom: 10px">
    <a id="aDrafts" runat="server" href="javascript:void(ToggleVisibility());" />
    <ul id="ulDrafts" runat="server" style="display:none;list-style-type:circle" />
  </div>

  <label for="<%=txtTitle.ClientID %>"><%=Resources.labels.title %></label>
  <asp:TextBox runat="server" ID="txtTitle" Width="450px" />&nbsp;&nbsp;&nbsp;
 
  <label for="<%=ddlAuthor.ClientID %>"><%=Resources.labels.author %></label>
  <asp:DropDownList runat="Server" ID="ddlAuthor" />&nbsp;&nbsp;&nbsp;
 
  <label for="<%=txtDate.ClientID %>"><%=Resources.labels.date %></label>
  <asp:TextBox runat="server" ID="txtDate" Width="110px" />
 
 
  <asp:CheckBox runat="server" ID="cbUseRaw" Text="Use HTML editor" AutoPostBack="true" />
 
  <asp:RegularExpressionValidator runat="server" ControlToValidate="txtDate" ValidationExpression="[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [0-9][0-9]:[0-9][0-9]" ErrorMessage="Please enter a valid date (yyyy-mm-dd hh:mm)" Display="dynamic" ValidationGroup="post" />
  <asp:RequiredFieldValidator runat="server" ControlToValidate="txtDate" ErrorMessage="Please enter a date (yyyy-mm-dd hh:mm)" Display="Dynamic" ValidationGroup="post" />
  <asp:RequiredFieldValidator runat="server" ControlToValidate="txtTitle" ErrorMessage="Please enter a title" Display="Dynamic" ValidationGroup="post" />
  <br /><br />
 
  <Blog:TextEditor runat="server" id="txtContent" />
  <asp:TextBox runat="server" ID="txtRawContent" Width="100%" TextMode="multiLine" Height="300px" Visible="false" />
  <br />
 
  <table id="entrySettings">
    <tr>
      <td><%=Resources.labels.uploadImage %></td>
      <td>
        <asp:FileUpload runat="server" ID="txtUploadImage" Width="400" size="50" ValidationGroup="imageupload" />
        <asp:Button runat="server" ID="btnUploadImage" Text="Upload" ValidationGroup="imageupload" />
        <asp:RequiredFieldValidator runat="Server" ControlToValidate="txtUploadImage" ErrorMessage="<%$ Resources:labels, required %>" ValidationGroup="imageupload" />
      </td>
    </tr>
    <tr>
      <td><%=Resources.labels.uploadFile %></td>
      <td>
        <asp:FileUpload runat="server" ID="txtUploadFile" Width="400" size="50" />
        <asp:Button runat="server" ID="btnUploadFile" Text="Upload" ValidationGroup="fileUpload" />
        <asp:RequiredFieldValidator runat="server" ControlToValidate="txtUploadFile" ErrorMessage="<%$ Resources:labels, required %>" ValidationGroup="fileUpload" />
      </td>
    </tr>    
    <tr>
      <td>Slug (optional)</td>
      <td>
        <asp:TextBox runat="server" ID="txtSlug" Width="400" />
        <a href="javascript:void(GetSlug());">Extract from title</a>
      </td>
    </tr>
    <tr>
      <td><%=Resources.labels.description %></td>
      <td><asp:TextBox runat="server" ID="txtDescription" TextMode="multiLine" Columns="50" Rows="3" Width="400" Height="32px" /></td>
    </tr>
    <tr>
      <td><%=Resources.labels.categories %></td>
      <td>
        <asp:TextBox runat="server" ID="txtCategory" ValidationGroup="category" />
        <asp:Button runat="server" ID="btnCategory" Text="<%$ Resources:labels, add %>" ValidationGroup="category" />
        <asp:CustomValidator runat="Server" ID="valExist" ValidationGroup="category" ControlToValidate="txtCategory" ErrorMessage="The category already exist" Display="dynamic" />
        <asp:RequiredFieldValidator runat="server" ControlToValidate="txtCategory" ErrorMessage="Required" ValidationGroup="category" /><br />
        <div style="width:400px">
        <asp:CheckBoxList runat="server" Width="400" ID="cblCategories" CssClass="cblCategories" RepeatLayout="flow" RepeatDirection="Horizontal" />
        </div>
      </td>
    </tr>
    <tr>
      <td>Tags</td>
      <td>
        <asp:TextBox runat="server" ID="txtTags" Width="400" />
        <a href="javascript:void(ToggleTagSelector())">Show selector</a>
        <span><%=Resources.labels.separateTagsWitComma %></span>
      </td>
    </tr>
    <tr>
      <td><%=Resources.labels.settings %></td>
      <td>
        <asp:CheckBox runat="server" ID="cbEnableComments" Text="<%$ Resources:labels, enableComments %>" Checked="true" />
        <asp:CheckBox runat="server" ID="cbPublish" Text="<%$ Resources:labels, publish %>" Checked="true" />
      </td>
    </tr>
  </table>  
 
  <div style="text-align:right">  
    <asp:Button runat="server" ID="btnSave" ValidationGroup="post" />
  </div>
  <br />
<% if (Request.QueryString["id"] == null){ %>  
  <script type="text/javascript">
    setTimeout("AutoSave()", 5000);
  </script>
<%} %>
</asp:Content>

Sep 9, 2009 at 10:34 AM

Thanks Ben. Will give our web man this message and see what he can do with it. Will keep you posted.

Sep 26, 2010 at 2:53 AM

I have the same problem with IE.  I tried the above fix and still the same problem.  I can post by just picking any file and not clicking the upload button, but it is a bit of a pain.

Firefox works better but I find that I have other issues with it in other areas of the interface.  This is the only IE problem I have encountered.