Creating a List programmatically by using out of the box List Template Types
Dim site As SPSite = SPContext.Current.Site
Dim web As SPWeb = site.RootWeb
web.AllowUnsafeUpdates = True
Dim _listname As String = listname.Text
Dim listExist As Boolean = False
For Each list As SPList In web.Lists
If _listname.ToLower() = list.RootFolder.Name.ToLower() Then
listExist = True
Exit For
End If
Next
If listExist Then
Response.Write("List...
Monday, 29 December 2014
Save & Delete List Templates programmatically in SharePoint
Save a List Template in Sharepoint
Dim site As SPSite = SPContext.Current.Site
Dim web As SPWeb = site.OpenWeb()
web.AllowUnsafeUpdates = True
SPList lstSource = oSPWeb.Lists["SourceList"];
lstSource.SaveAsTemplate("FileName.stp", "Name", "Description", false);
lstSource.Update();
Delete a List Template in Sharepoint
Dim oSPsite As SPSite = New SPSite("http://myserver/site"))
Using oSPWeb As SPWeb = oSPsite.OpenWeb()
Dim...
How to Add or Delete List Items in Sharepoint (Inside Folder)
Creating List Item
Dim mySite As SPWeb = SPContext.Current.Web
Dim listItems As SPListItemCollection = mySite.Lists(TextBox1.Text).Items
Dim item As SPListItem = listItems.Add()
item("Title") = TextBox2.Text
item("Stock") = Convert.ToInt32(TextBox3.Text)
item("Return Date") = Convert.ToDateTime(TextBox4.Text)
item("Employee") = TextBox5.Text
item.Update()
Deleting List Item
Dim mySite As SPWeb = SPContext.Current.Web
Dim...
Retrieving SharePoint List Data using CAML
Basic CAML query properties used in sharepoint
Group by :- used to group the data in list view
Order by :- used to sort the list either in ASCENDING or DECENDING
Row limit :- used to set the limit of item returned from qury
View fields :- used to filter fields from the list
View...
HOW TO USE CAML QUERY IN SHAREPOINT TO FETCH LIST ITEMS
CAML represents Collaborative Markup Language which is an XML based language for querying and updating SharePoint objects.
CAML Query Comparison Operators:
Tag Name Meaning
ContainsContains a given text value
EqEqual to
GeqGreater than or equal to
GtGreater than
LeqLess than or equal to
LtLess than
NeqNot equal to
DateRanges
OverlapCompares dates in recurring events to determine if they overlap
IsNotNullIs...
InputFormTextBox Validation(Rich TextBox in Sharepoint)
InputFormTextBox Validation(Rich TextBox in Sharepoint)
In this post I will tell how to validate the InputFormTextBox contol using custom JavaScript function…if u Use RequiredFieldValdator or InputFormRequiredFieldValidator with InputFormTextbox U ll get some validation Issues Onclick Validation Button…Instead of RequiredFieldValidation Just do with CustomValidator .
This is an example...
Diifrent ways to get logged in User Name & Handling Changes in Form Based Authentication User's
To get the logged in user name you have the following methods available in SharePoint 2010 Web Part User Control:
this.Page.User.Identity.Name
HttpContext.Current.User.Identity.Name
SPContext.Current.Web.CurrentUser.LoginName
SPContext.Current.Web.CurrentUser.Name
Programmatically converting login name to claim and vice versa
string userName = null;
SPClaimProviderManager mgr...
Subscribe to:
Posts (Atom)