Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Get step to create subsite in sharepoint

Answer»

Below are few steps to CREATE a subsite in sharepoint.
(1)First click on SITE settings wheel on the upper right corner of site and then Site Contents page.



SubSite Men

(2)Now select Site Contents after that we need to check New Subsite on the Site Contents Page




SubSite Option

(3)Now enter Title DESCRIPTION Web Site ADDRESS and some other fields like permission page will display



SubSite OtherInfo

2.

How to create Custom List using Sharepoint Designer 2013

Answer»

There are simply three STEP to create CUSTOM List using sharepoint designer 2013
(1)In SharePoint Designer 2013 and after that navigate and then SharePoint List and then select the Custom List.

Sharepoint customlist


(2)AFter in NEXT screen as per given below we NEED to add name and description for the list


Sharepoint custom list

(3)Click Ok once we done.

3.

Code to get all the server list in Sharepoint Farm

Answer»

Below is the code to get NAME of all the server available in the FARM with there address and roles.


SPFarm farm = SPFarm.Local;

Console.WriteLine("Below are the list of servers in Farm");

FOREACH (SPServer server in farm.Servers)
{
Console.WriteLine("ServerName", server.Name);
Console.WriteLine("ServerAddress", server.Address);
Console.WriteLine("ServerRole", server.Role);
}

4.

How to delete sitepage and check exists or not in sharepoint

Answer»

Below is the code for CHECK FILE is-EXISTS or not if exists then delete the file


SPWeb site=SPContext.Current.Web;
SPFIle sitePage=site.GetFile("filename.aspx")
if(sitePage.Exists)
{
sitePage.Delete();
}

5.

Binding DropDownList with Sharepoint List data using code

Answer»

Below code will PROVIDE you the METHOD that how to BIND list data in sharepoint
if (!Page.IsPostBack)
{
DataSet ds = new DataSet();
aSPSite mySite = SPContext.Current.Site;
SPWeb myWeb = mySite.OpenWeb();
SPList list = myWeb.Lists["LISTNAME"];
DataTable DTable_List = list.Items.GetDataTable();
DTable_List.TableName = "Table1";
ds.Tables.Add(DTable_List);
DropDownList.DataSource = ds.Tables["Table1"];
DropDownList.DataTextField = "FieldName";
DropDownList.DataValueField = "FieldName";
DropDownList.DataBind();
DropDownList.SelectedIndex = 0;
}

6.

How to add External Javascript, CSS, Image, Button in WepPart

Answer»

How to add External JAVASCRIPT, CSS, Image, Button in WepPart

Below is the code to add css,image,javascript and button to webpart

Button btn;
Image IMG;
string imgPath;

// REFERRING External Javascript
// Include the required javascript file.
ClientScriptManager CS = Page.ClientScript;
if (!cs.IsClientScriptIncludeRegistered("jsfile"))
cs.RegisterClientScriptInclude(this.GetType(), "jsfile", "/_wpresources/javascript/jsscript.js");

//Add Button in webpart
btn= new Button();
btn.Text = "Click here";
// specify function name here
btn.OnClientClick = "ButtonClick()";
this.Controls.Add(btn);

// Refering External CSS
Microsoft.SharePoint.WebControls.CssLink cssLink = new Microsoft.SharePoint.WebControls.CssLink();
cssLink.DefaultUrl = "/_wpresources/styles/styles.css";
this.Page.Header.Controls.Add(cssLink);

// Using External Image
imgPath = "/_wpresources/images/Imglogo.jpg";
img.ImageUrl = imgPath;
img.ID = "image1";
this.Controls.Add(img);