Friday, 29 January 2010

Create a webpage with Div tags and no tables

I was searching to figure out how to create a page layout with no tables for one of my SharePoint projects. I designed one with the basic <div> tag and css and no <tables>, I used inline CSS script for this.


The code I used is as below

<!--

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<!-- <link rel="stylesheet" href="" type="text/css"> -->

<html>

<head>

<style type="text/css">

#wrapper{

width:1000px;

margin:0px auto;

border:1px solid #acb;

padding:10px;

}

#header {

border:1px solid #bbb;

height:100px;

padding:10px;

}

#content {

margin-top:10px;

padding-bottom:10px;


}


#content div {

padding:10px;

border:1px solid #bbb;

float:left;

}

#content-left {

width:180px;

height:500px;

}


#content-main {

width:585px;

height:500px;

margin-left:10px;

}


#content-right {

width:150px;

height:500px;

margin-left:10px;

}

#footer {

float:left;

margin-top:10px;

margin-bottom:10px;

border:1px solid #abc;

height:80px;

padding:10px;

height:80px;

width:980px;

}

#bottom {

clear:both;

text-align:right;

}

</style>

</head>

<body>

<div id="wrapper">

<div id="header"><center>Header</center></div>

<div id="content">

<div id="content-left">Left Content</div>

<div id="content-main"><center>Main Content</center></div>

<div id="content-right"><center>Right Content</center></div>

</div>

<div id="footer"><center>Footer</center></div>

<div id="bottom"></div>

</body>

</html>

-->

Thursday, 28 January 2010

How to create files of any size

How to create files of any size

fsutil file createnew C:\Brij\One_MB_File.doc 1024000

Above command will create 1 MB file called "One_MB_File.doc" at C:\Brij location.

You can provide any file extension - e.g. .txt, .xls, .ppt, .pdf etc.

This command may help in creating files for upload/download test in SharePoint or any other application.

Thursday, 21 January 2010

Sharepoint Maintenance Page

Recently I got a requirement asking me to create a "Maintenance Page" in my Sharepoint Farm for a new Release.
I was trying to set a simple "Offline.htm" page in IIS and setting it as the default page in the Documents, but unfortunately this would never work as in a regular .Net application. Done a bit research and found a good article of Scott Guthrie. I would walk through the steps to get this done -
Step 1.Create a page "App_Offline.htm" in the Root Site - When Asp.net see this page it would unload the AppDomain for the application and would render this page.
However, there is a catch, I was trying to do this the application was down but the page was not rendered instead I was getting a 404, found out this was because if the content in the ".htm" page is less than 512 bytes IE would only render the custom error page.

Step 2.
Make the Page size greater than the limit, something similar to this- Bingo !!! and it should work .