InterviewQuestions
Best SharePoint Interview Questions and Answers with topic wise:
Webparts & Webparts1 | Event Receivers | Event Receivers1 | Workflows: | MasterPages & MasterPage1| Content Database | Common Real-time issues | Permissions | SPQuery vs. SPSiteDataQuery | ListVsLibrary | ListVsLibrary2 | Content Types | Pages | ListVsLibrary2 | PowerShell |
Interview Questions administrator
Best SharePoint administrator Interview Questions and Answers with topic wise:
Recycle Bin | MMS | ManagedVsCrawledProperties |
Showing posts with label Visual Studio. Show all posts
Showing posts with label Visual Studio. Show all posts
Sunday, May 5, 2013
Saturday, May 4, 2013
Create Client Web Part to the App using visual studio 2012
Saturday, April 20, 2013
Creating a Custom List using Visual studio 2012:
In this exercise, you will work through the basics of
creating, testing and debugging a custom list type using the new list designer
in Visual Studio 2012.
Download: https://sites.google.com/site/sasivalipireddy/home/Create custom list using VS2012.pdf
Download: https://sites.google.com/site/sasivalipireddy/home/Create custom list using VS2012.pdf
1. Launch Visual Studio 2012.
2. Create a new SharePoint
2013 – Empty Project and name this new project CustomListSolution. Click OK on the New Project dialog.
Wednesday, February 22, 2012
How to: Delete a list programtically
#region DeleteBAEList ////// FUNCTION : DeleteList /// PURPOSE : To delete the list /// PARAMETERS : currentWeb -> current web /// strListName -> A string containing the list name /// RETURNS : None /// ------------------------------------------------------------------------- /// public static void DeleteList(SPWeb currentWeb, string strListName) { try { currentWeb.AllowUnsafeUpdates = true; if (IsListExists(strListName, currentWeb) == true) { SPList lst = currentWeb.Lists[strListName]; currentWeb.Lists.Delete(lst.ID); } currentWeb.AllowUnsafeUpdates = false; } catch (Exception ex) { //Error Handling Code } } #endregion
I already
covered in my previous posts about how to check whether the specified lists
exist or not? And what/why/where we can use “AllowUnsafeUpdates”.
Refer to get clear idea on it.
Refer to get clear idea on it.
- Check for the specified list exists or not also here.
- Refer to know about "AllowUnsafeUpdates"
- Error handling technique:
Happy Coding....
Add Columns / Fields Programmatically to a SharePoint List
Before
adding column(field) to the specified list it’s better to check whether that
lists exists or not and new created field already exists or not? In my code, I
am checking all these conditions.
Tuesday, February 21, 2012
How to check if a list exists or not in SharePoint
It’s
a very common programming practice to check our newly created list already
exists in the specified web or not? Below code will help you on this scenario.
Before adding column(field) to the specified list it’s better to check whether that lists exists or not and new created field already exists or not? In my code, I am checking all these conditions.
Before adding column(field) to the specified list it’s better to check whether that lists exists or not and new created field already exists or not? In my code, I am checking all these conditions.
How to: Create a list in sharepoint programmatically
Before creating a
list it’s better to check your newly created list already exists in the
specified web or not and also if you are creating new list by using custom list
template, we have to check if list template exists or not also.
Like
similar ways,
- How to check if a list exists or not?
- How to check if a list template exists or not?
- How to delete list?
- Error handling technique:
//To create a list
#region List Template
String ListTemplateName=”CustomListTemplateName”;
String ListName=”CustomListName”;
SPListTemplateCollection listTempColl = currentSite.GetCustomListTemplates(currentSite.RootWeb);
//checking if the list template exists or not before creating a list reason we are creating a custom list using custom template)
if (IsListTemplateExists(ListTemplateName, listTempColl) == true)
{
//Creating the custom list using custom list template.
SPListTemplate listQuickLinksTemp = listTempColl[ListTemplateName];
CreateList(currentWeb, ListName, "Description of the list", listQuickLinksTemp);
}
#endregion
#region CreateList
///
/// FUNCTION : CreateList
/// PURPOSE : To create the list
/// PARAMETERS : currentWeb -> current web
/// strListName -> A string containing the list name
/// strlstDesc -> A string containing the list description
/// lstTemplate -> A list template
/// RETURNS : None
/// -----------------------------------------------------------------------
///
public static bool CreateList(SPWeb currentWeb, string strListName, string strlstDesc, SPListTemplate lstTemplate)
{
try
{
currentWeb.AllowUnsafeUpdates = true;
//Checking list exists or not
if (IsListExists(strListName, currentWeb) == true)
{
return false;//list already exists
}
else
{
//Create the list using template
currentWeb.Lists.Add(strListName, strlstDesc, lstTemplate);
currentWeb.AllowUnsafeUpdates = false;
}
catch (Exception ex)
{
//Code
}
return true;
}
#endregion
Please refer to get an idea about on what/why/where "AllowUnSafeUpdate".
Subscribe to:
Posts (Atom)

