Friday, 31 August 2012

How to set 2 two background image using css style class in body tag elements html

HTML CSS Tricks 1: ( To apply background image for whole page )

We could set two background images using html and body tag elements in CSS styles class.
The below sample code snippet used to set the background image (tile.jpg) / color for the whole page (html css) and bc_head.png image has to be displayed just above the background tile image / color.
 
html {
                    background: #000 url("images/tile.jpg")  repeat;
                }                            
body {
                    background: url("images/bc_head.png")  repeat-x;
                    background-position: left top;
               

HTML CSS Tricks 2:( To apply background image for not whole page and only for body  )


To apply background image for not whole page and only for body, Consider the following code.
We can create table / div elements inside body tag and write css style class names.

HTML Source:

<body>
<table> <tr>
<td class="a"><div class="b">...</div></td>
</tr></table>
 </body>

CSS style Class name:

.a
{
  background-image: url(a.png);
}
.b
{
  background-image: url(b.png);
}

Thursday, 30 August 2012

How do check if file or image url exists using jQuery or Javascript json js ajax


Approach 1: (If its any file with any extension) :

To check whether files exist in file system, the best way to do this is with an AJAX HEAD request. HEAD requests only ask for and return the header from the destination file, so they’re much faster than POST or GET requests. Perfect for a simple file check.
It’s also returns the content length and last modified date and that jQuery has an “ifModified” option for the .ajax function that returns a Boolean value.
This jquery / javascript /js will be useful to check the image / file existence by providing source complete URL path  or relative URL path

Sample Demo Code

$.ajax({
    url:images/header.jpg',
    type:'HEAD',
    error:
        function(){
            alert(‘no File exist);
        },
    success:
        function(){
            alert(‘File exist’);        }
});

Approach 2 : (If its Image File with its related extension.)

The above approach is most recommended since this approach is not that much reliable and performance when compared to it to check existence.

HTML Source:
<img id=”image_id” src=” images/header.jpg” alt=”” />

JQuery:

This Jquery js will get call automatically when image is not available / loaded 
from file system or repository or directory.
 
$('#image_id').error(function() {

  alert('Image does not exist !!');

});
 

Wednesday, 22 August 2012

class library dll’s not added / installed / referenced / moved to assembly GAC while deployment of package automatically in SharePoint SP 2010 / 2007

To install classlibrary dll to GAC automatically during the deployment of WSP package of Sharepoint SP 2007 / 2010, refer the following instruction steps,

1. Open the Package designer in the SharePoint project.
2. Select the Advanced tab.
3. Click the Add button.
4. Select the Add Assembly from Project Output menu item.
5. Use the Source Project dropdown to select which project in your solution should have its assembly included.
6. Make sure the Deployment Target is set to GlobalAssemblyCache.
7. Click OK.
8. Repackage and redeploy the SharePoint project. 

The WSP package should now contain the class library's assembly and the WSP's package manifest should have been updated according.,

For more details, please refer : 

Tuesday, 14 August 2012

How to delete Corrupted / errored list / picture library in SharePoint SP 2010 /2007

The reason for  error like " Exception from HRESULT 0×81070215  " is custom list definition and list instance is not properly defined. That means field / columns in the content type has issues with that (some necessary fields / column might not be be defined there)
Please try to fix this by doing correct list definition, list instance and its content type otherwise delete the list using stsadm.exe force delete command

If you receive error Exception from HRESULT 0×81070215 when you open a list in browser or access the SharePoint site manager, a list has not properly been deleted and is in a corrupted state, which means you can not able to delete using browser hence you have to delete the corrupted list using stsadm forcedeletelist command.

Steps:

  • Go to start->run->cmd (it will open command window)
  • For Sharepoint 2007, Use cd C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\BIN
  •  For Sharepoint 2010, Use cd C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN.
  • To find the help for forcedeletelist user following command,
    • Stsadm –help forcedeletelist
  • To delete particular corrupt list use following command,