Online Chat
 Call Us: 
1-877-744-1221
Browse Submit a Ticket
 
Advanced Search
Tools
Rss Categories

Publish content to a site with ASP.NET (without PHP support)

Author: Edward Hardin Reference Number: AA-00518 Views: 12422 Last Updated: 03/11/2015 04:07 PM 0 Rating/ Voters

Usually you need PHP installed on both websites:

  • Website with Knowledgebase Manager Pro instance
  • Target website, where you want to publish some part of your KB

However, if target website doesn't support PHP, you can use ASP publication instead.

This guide assumes that you have some knowledge of ASP and C# technologies.

  1. Login to KMP and go to Administration > Publishing > Publications and click the "Get Code" button for your publication. It you do not have a publication yet, you can create it right now.
  2. Find the place where we assign some value to the $url variable.



  3. Copy that URL (everything between quotation marks). We will need it later.
  4. Download WSS.KMP.zip file below.
  5. Extract the WSS.KMP.dll from the downloaded file.
  6. Put this library to the appropriate directory of your ASP project (e.g. "Bin" directory).
  7. Add a reference for the uploaded library in your ASP project (for example publication.aspx.cs file).

    using System;

    using WSS.KMP;

    public partial class publication : WSS.KMP.KmpPage

    {

      protected void Page_Load(object sender, EventArgs e)

      {

         KnowledgeBase = new KnowledgeBaseManager(this,

      "http://www.yourwebsite.com/kmp/admin/gateway_main/{0}/3/f449b7cad9f012f4397a5fb2ac8efec2/{1}");

         KnowledgeBase.Load();

      }

    }

    Look at the highlighted {0} and {1} above. You need to copy-paste the URL that you got from Get Page window and insert it instead of URL in this example.
    The "$action" part of URL must be replaced with "{0}" and the "$getData" part must be replaced with {1}

  8. Now we can actually publish KB content to our web page.
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="publication.aspx.cs" Inherits="publication" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
       <title><%=KnowledgeBase.Title%></title>
       <%=KnowledgeBase.Keywords%>
       <%=KnowledgeBase.MetaDescription%>
    </head>
    <body>
       <%=KnowledgeBase.Content%>
    </body>
    </html>

    This is a basic ASPX page layout. Parts that we added to the page to publish KB content are highlighted.

Attachments
WSS.KMP.zip 5.7 Kb Download File