Wednesday, December 19, 2012

To see a list of all application pools in IIS 7.x, run the following command in an elavated priviliges command prompt:

%windir%\system32\inetsrv\appcmd.exe list wp


For IIS 6.x or lesser the corresponding command is iisapp. The list shows application pool number and its name.

To recycle an application pool, use the following syntax:

appcmd recycle apppool /apppool.name: string


Powershell needs to refer to correct assembly to access details of application pools like so:

[Void][Reflection.Assembly]::LoadWithPartialName("Microsoft.Web.Administration")

$sm = New-Object Microsoft.Web.Administration.ServerManager

foreach($site in $sm.Sites)
{
    $root = $site.Applications | where { $_.Path -eq "/" }
    Write-Output ("Site: " + $site.Name + " | Pool: " + $root.ApplicationPoolName)
}


HTML table layout with div tag

http://coding.smashingmagazine.com/2009/04/08/from-table-hell-to-div-hell/
http://stackoverflow.com/questions/702181/replace-html-table-with-divs
http://www.htmlgoodies.com/beyond/css/web-development-case-study-upgrading-tables-to-divs.html
http://www.codeproject.com/Articles/47934/DIV-TABLE
http://www.brunildo.org/test/inline-block.html
http://jsfiddle.net/clairesuzy/bHMXw/

my code modified from stackoverflow above:


<style type="text/css">
div.block{
  overflow:hidden;
}
div.block label{
  width:160px;
  display:block;
  float:left;
  text-align:left;
}
div.block .input{
  float:left;
  width:150px;
}
div.block select{
  display:inline;
  width:150px;
}
div.separator
{
  display:inline;
  border:none;
  width:4px;
}
div.separator table{
  display:inline;
  border:none;
  margin-left:10px;
  margin-right:10px;
  vertical-align:middle;
}
div.rowdiv{
  display:table-row;
}
div.tablediv{
  display:inline;
  border:none;
  vertical-align:top;
}
</style>
<h1>My code</h1>
 
<div class="block">
  <label>First Name</label><div class="separator"></div>
    <input  id="txtFirstName"/>
&nbsp;</div><br />
<div class="block">
  <label>Last Name</label><div class="separator"></div>
    <input  id="txtLastName"/>
</div><br />

<div class="block">
    <label>New User?</label><div class="separator"></div>
    <div class="tablediv">
        <div class="rowdiv">
            <input type="radio" />&nbsp;Yes
        </div>
        <div class="rowdiv">
            <input type="radio" />&nbsp;No
        </div>
    </div>
</div><br />
<div class="block">
 
 
    <input type="submit" />
   
 
</div><br />


Monday, December 17, 2012

There is no OOB method of lists.asmx to create a new list item, instead use below link to create a list item using infopath & web services

http://msdn.microsoft.com/en-us/library/cc162745(office.12).aspx

Friday, December 7, 2012

SharePoint 2010: Move search box to top of a site

Use this style in masterpage to move search box to top dark bar in a sharepoint 2010 site


<style>
.s4-search {
                RIGHT: 200px! important; POSITION: fixed; TOP: 10px
}
.s4-titlesep{
display:none;
}
td.s4-titletext h2{
display:none;
}
</style>

SSL Error - The connection for this site is not secure

 After cloning a git repo of dot net framework website and trying to run it all I could see was this error Turns out the fix was to simply e...