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();

Thursday 27 February 2014

Lamda Expression In LINQ

Lamda Expression In LINQ :

Lambda expressions are similar to anonymous methods introduced in C# 2.0, except that lambda expressions are more concise and more flexible. All lambda expressions use the lambda operator =>, which is read as “goes to”. The left side of the lambda operator specifies the input parameters and the right side holds the expression or statement block.

For Anonymos Funcation, use the below link :
http://computerauthor.blogspot.in/2011/08/c-interview-questions-what-are.html


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        delegate int PointToDelegate(int x, int y);

        static void Main(string[] args)
        {

            //Console.WriteLine(Convert.ToString(Add(10, 5)));


            // WithOut Use Of Anonymos Funcation

            PointToDelegate objFun = Add;
            int reslt1 =objFun(5, 5);
            Console.WriteLine(Convert.ToString(reslt1));

           
           
            // With the Anonymos Funcation
            PointToDelegate objFunWithAny = delegate(int m, int n)
                                            {
                                                Console.WriteLine("This is Delegate Inline Defination");
                                                return m + n;
                                            };

            int reslt2 = objFunWithAny(5, 7);
            Console.WriteLine(Convert.ToString(reslt2));
           
           
            // With the Lamda Expression

            Func<int, int, int> func1 = (x, y) => { return x + y; };
            int reslt3= func1.Invoke(10, 9);
            Console.WriteLine("This is Using the Lambda Expression");
            Console.WriteLine(Convert.ToString(reslt3));
           
            Console.WriteLine();
        }


        static int Add(int a, int b)
        {
            Console.WriteLine("This is Add Funcation");

            return a + b;
        }

       
    }
}