Software Development Network>> SharePoint Products>> how to access the current list name programmaticaly while creating a new list item
You will need to create a custom EventHandler hooked up to the ItemAdding event. Inside the EventHandler:
public override void ItemAdding(SPItemEventProperties properties)
{
SPList list = properties.ListItem.ParentList;
string listName = list.Title;
}
If you have an SPList object called oList that points to the current list, you might be looking for oList.Title.
properties.ListItem returns NULL for me
we shold do
properties.OpenWeb().GetList(properties.OpenWeb().url+"ListsName").Items[listItem.Items.Count - 1]["Title"].toString(); -Sudip
properties.OpenWeb()
-Sudip
how to access the current list name programmaticaly while creating a new list item
mobigital
You will need to create a custom EventHandler hooked up to the ItemAdding event. Inside the EventHandler:
public override void ItemAdding(SPItemEventProperties properties)
{
SPList list = properties.ListItem.ParentList;
string listName = list.Title;
}
aashta
If you have an SPList object called oList that points to the current list, you might be looking for oList.Title.
arkiboys
properties.ListItem returns NULL for me
we shold do