Tuesday, 30 June 2015

Cascading DropDown Using SPServices in SharePoint 2013


For Cascading Drop down, first of all we need to refer two scripts as shown in the code and also need to store that files at the proper path in Sharepoint Site content or in any other library.

If we need to put the cascading dropdown in the List forms, we need to put the below code at the relative NewForm.aspx and EditForm,aspx in the ListForms and put the below code at the "PlaceHolderAdditionalPageHead" .


<asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">


<script language="javascript" type="text/javascript" src="../../JSLibrary/jquery-1.7.2.min.js"></script>
<script language="javascript" type="text/javascript" src="../../JSLibrary/jquery.SPServices-0.7.1a.min.js"></script>



<script type="text/javascript">

$(document).ready(function() {
$().SPServices.SPCascadeDropdowns({
relationshipList: "Facilities",
relationshipListParentColumn: "Process",
relationshipListChildColumn: "Title",
parentColumn: "Process",
childColumn: "FacilityName",
promptText: "Choose Facility...",
debug: true

});

});
</script>

</asp:content>

Tuesday, 24 February 2015

Custom Master Page Add an app Loading Page Issue

Add the below snippet at the proper place in your custom master page will solve you problem

 <div id="s4-workspace">
            <div id="s4-bodyContainer">
           
         
               <div class="ms-dialogHidden" style="display:none;">
                            <h1 id="pageTitle" class="ms-core-pageTitle">
                                <!-- ===== STARTER: Needed for Adding Apps from Site Contents ======================================================================================= -->
                                <!--SPM:<SharePoint:AjaxDelta id="DeltaPlaceHolderPageTitleInTitleArea" runat="server">-->
                                <!--SPM:<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server">-->
                                    <!--SPM:<SharePoint:SPTitleBreadcrumb runat="server" RenderCurrentNodeAsLink="true" SiteMapProvider="SPContentMapProvider" CentralAdminSiteMapProvider="SPXmlAdminContentMapProvider">-->
                                        <!--SPM:<PATHSEPARATORTEMPLATE>-->
                                            <!--SPM:<SharePoint:ClusteredDirectionalSeparatorArrow runat="server"/>-->
                                        <!--SPM:</PATHSEPARATORTEMPLATE>-->
                                    <!--SPM:</SharePoint:SPTitleBreadcrumb>-->
                                <!--SPM:</asp:ContentPlaceHolder>-->
                                <!--SPM:</SharePoint:AjaxDelta>-->   
                                <div class="ms-displayInlineBlock ms-normalWrap">
                                    <a href="javascript:;" id="ms-pageDescriptionDiv" style="display:none;">
                                        <span id="ms-pageDescriptionImage">&#160;</span>
                                    </a>
                                    <span class="ms-accessible" id="ms-pageDescription">
                                        <!--SPM:<asp:ContentPlaceHolder id="PlaceHolderPageDescription" runat="server"/>-->
                                    </span>
                                    <!--SPM:<SharePoint:ScriptBlock runat="server">-->
                                        <!--SPM:_spBodyOnLoadFunctionNames.push("setupPageDescriptionCallout");-->
                                    <!--SPM:</SharePoint:ScriptBlock>-->
                                </div>
                            </h1>
                        </div>
                       
           
            <div id="sideNavBox" class="ms-dialogHidden ms-forceWrap ms-noList" style="display:none;">
                        <div class="ms-core-navigation">
                            <!--SPM:<asp:ContentPlaceHolder ID="PlaceHolderLeftNavBar" runat="server">-->
                                <!--SPM:<asp:ContentPlaceHolder ID="PlaceHolderLeftNavBarTop" runat="server">-->
                                    <!-- ===== STARTER: hide the quick launch for any page the doesn't override the PlaceHolderLeftNavBar ============ -->
                                    <!-- ===== STARTER: if you want the navigation back you can add it from the collab master ============ -->
                                    <!--SPM:<style type="text/css">//<![CDATA[-->
                                        <!--SPM:#contentBox { margin-left: 0; }-->
                                        <!--SPM:#sideNavBox { display: none; }-->
                                    <!--SPM://]]></style>-->
                                <!--SPM:</asp:ContentPlaceHolder>-->
                                <!--SPM:<asp:ContentPlaceHolder ID="PlaceHolderQuickLaunchTop" runat="server"/>-->
                                <!--SPM:<asp:ContentPlaceHolder ID="PlaceHolderLeftNavBarDataSource" runat="server"/>-->
                                <!--SPM:<asp:ContentPlaceHolder ID="PlaceHolderCalendarNavigator" runat="server"/>-->
                                <!--SPM:<asp:ContentPlaceHolder ID="PlaceHolderLeftActions" runat="server"/>-->
                                <!--SPM:<asp:ContentPlaceHolder ID="PlaceHolderQuickLaunchBottom" runat="server"/>-->
                            <!--SPM:</asp:ContentPlaceHolder>-->
                        </div>
                    </div>

// other content

</div>
</div>

Wednesday, 15 October 2014

Creating new Web Application Error: This page can’t be displayed

While creating a new web application, a 404 'Page not found' error is displayed and the web application is only provisioned on the local server
After a number of web applications have been created in the SharePoint 2010 farm, further attempts to create a new web application through Central Administration result in the following:
The creation process results in a 'Page cannot be displayed' message.
The web application is only provisioned on the Central Administration server.
But if you try to create a site collection on this newly created web app, it fails. Reason is it is not completely done.
After struggling this for a while I found you can resolve by increasing the Shutdown time limit in IIS to a greater value.
Steps
Go to application pool of Central Administration.
Right click on it and go to Advanced Settings
In the Process Model section, increase the shutdown time limit to 200 for example.
It is a good idea to restart IIS now.
After searching on net for a while I found that the reason is during the web application creation process IIS is reset and by default. It allows the "Shutdown time limit" which by default is 90 seconds. Sometimes this might not be enough. And hence it forcibly shuts down in 90 seconds.

Wednesday, 1 October 2014

How to give the css and js file refernce in the Visual webpart from the Custom folder In SharePoint 2013

Suppose,
I want to give reference of the css and some js file in my custom web part and it is stored in my custom folder of the master page directory.
Then just need to add the links as below:


For CSS : 
<link rel="stylesheet" type="text/css" href="/_catalogs/masterpage/[foldername]/[filename]"/>



For js File:
<script type="text/javascript" src="/_catalogs/masterpage//[foldername]/[filename]"></script>


Fix: SharePoint Designer 2013: The server could not complete your request. For more specific information, click the Details below.



This happens when the current user request for some data using the SharePoint WCF Service and the server fails him due to not having the proper rights for that.

In some times,for the authenticate user as well, you will get this kind of error.

Solution : iisreset will resolve this issue.


Tuesday, 30 September 2014

SharePoint 2013 Default css path

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\1033\STYLES\Themable

In this folder , corev15.css is the default css for the SharePoint site.

Tuesday, 16 September 2014

LINQ Crud Operation With Entity Framwork

                   
Insert the record :


EntityDB dataBase = new EntityDB();
Customer c = new Customer
{
     Name = "Test",
     Gender = "Male
};
dataBase.Customers.AddObject(c);
dataBase.SaveChanges();

Delete the record : 
Customer c = (from x in dataBase.Customers
             where x.Name == "Test"
             selext x).First();
dataBase.Customers.DeleteObject(c);
dataBase.SaveChanges();

Update the Record : 

Customer c = (from x in dataBase.Customers
             where x.Name == "Test"
             selext x).First();
c.Name = "New Name";
dataBase.SaveChanges();