How to use Live writer for creating Blog’s on SharePoint

 

When you want to configure your Live Writer to write Blog’s on SharePoint you must not select the option “SharePoint”.



Strange but true Glimlach

SNAGHTML2add71a

 

you must select ‘Other services’, next you just fill in the url of the site and your credentials and you are ready to go. Glimlach


Published: 2/22/2011 | 0  Comments | 0  Links to this post

Javascript printing page

For a project a requirement was to print a certain piece of the html code.
A custom webpart was created, that webpart contained a table which, if needed ,had to be printed.
With Javascript you are able to use the following command:
"window.print()"
to print your whole page, but in our case this was not the requirement.
The following code will look for a control called 'test', and will also print some more fields.
The extra field will be set by Javascript code.
 
 
 
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="testproject._Default" %>
<script type="text/javascript" language="javascript">
    var NewWindow;
    var Content;
    var Time = new Date();
    var stringContent;
    function PrintPage() {
        Content = document.getElementById('test');
        if (!NewWindow || NewWindow.closed) {
            NewWindow = window.open("", "", "");
            if (!NewWindow.opener) {
                NewWindow.opener = window;
            }
            setTimeout("writeToWindow()", 50);
        }
        else {
            NewWindow.focus();
        }
    }
    function writeToWindow() {
        stringContent = "<html><head></head><body onload='window.print()'>";
        stringContent += "<table>" + Content.innerHTML + "</table>" + "Printed for signature date:" + Time.getDay() + "/" + Time.getMonth() + "/" + Time.getFullYear();
        stringContent += "<br />";
        stringContent += "<br />";
        stringContent += "Signature :";
        stringContent += "<br />";
        stringContent += "<br />";
        stringContent += '<input type="text"/>';
        stringContent += "</body></html>";
        NewWindow.document.write(stringContent);
        NewWindow.document.close();
    }
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <input type="button" onclick="PrintPage()" title="Pint" style="width: 84px" />
    <div>
        <table id="test" runat="server">
            <tr>
                <td>
                    R1C1
                </td>
                <td>
                    R1C2
                </td>
                <td>
                    R1C3
                </td>
            </tr>
          
        </table>
        <br />
        Printed for signature date:
        <br />
        <br />
        Signature :
        <br />
        <br />
        <input type="text" style="width: 409px;" />
        <br />
        <br />
        <input type="button" text="Click"/>
    </div>
    </form>
</body>
</html>

Published: 9/27/2010 | 0  Comments | 0  Links to this post