public static string GetVersionedMultiLineTextAsPlainText(SPListItem item, string key)
{
StringBuilder sb = new StringBuilder();
foreach (SPListItemVersion version in item.Web.Lists[item.ParentList.ID].Items[item.UniqueId].Versions)
{
SPFieldMultiLineText field = version.Fields[key] as SPFieldMultiLineText;
if (field != null)
{
string comment = field.GetFieldValueAsText(version[key]);
if (comment != null && comment.Trim() != string.Empty)
{
sb.Append("");
sb.Append(version.CreatedBy.User.Name).Append(" (");
sb.Append(version.Created.ToString("MM/dd/yyyy hh:mm tt"));
sb.Append(")
");
sb.Append("-" + comment);
sb.Append("
");
}
}
}
return sb.ToString();
}
18 Aralık 2015 Cuma
7 Aralık 2015 Pazartesi
Button Click => FileUplaod
lnkbtnAddPhoto.Attributes.Add("onclick", "document.getElementById('" + FileUpload1.ClientID + "').click()");
24 Kasım 2015 Salı
Sharepoint infopath submit form by date/user/item id
Submit formula:
Referans:
http://www.spointblog.com/Pages/Post.aspx?ItemID=26
- concat(substring-before(now(); "T"); "-"; substring-after(userName(); "domain");"-";"formID=", max(ID) + 1 )
Referans:
http://www.spointblog.com/Pages/Post.aspx?ItemID=26
17 Kasım 2015 Salı
Sharepoint login as different user
Description="<%$Resources:wss,personalactions_loginasdifferentuserdescription%>"
MenuGroupId="100"
Sequence="100"
UseShortId="true" />
- C:\Program Files\Common Files\Microsoft shared\Web ServerExtensions\15\TEMPLATE\CONTROLTEMPLATES Gidip:
Welcome.ascx user kontrolünün NOTEPAD'le açıp içine yukarıda yazdığım kontrolü yapıştırıp kaydedin.
12 Kasım 2015 Perşembe
Event Receiver Properties
Library BeforeProperties AfterProperties properties.ListItem
ItemAdding No value No value Null
ItemAdded No value No value New value
ItemUpdating Original value Changed value Original value
ItemUpdated Original value Changed value Changed value
ItemDeleting No value No value Original value
ItemDeleted No value No value Null
Dursun bi şurda :D
11 Eylül 2015 Cuma
infopath -This session has exceeded the amount of allowable resources(Bu oturum izin verilen kaynak miktarını aştı)
Sharepoint InfoPath Forms Servisleri ile ilgili bir problem.
Formun içinde repeating table kullandığınızda her bir eklediğiniz değer postback sayısını ve session'ın büyüklüğünü arttırdığından dolayı karşılaşıcağınız bir problemdir.
Çözümü:
1.adım:
- SharePoint 2013 Central Administration açın
- General Application Setting => Configure InfoPath Forms Services'e gidip
2.adım:
Değerlerini değiştirdiğinizde problem çözülmüş olacak.
3 Eylül 2015 Perşembe
Office 365 - Sharepoint Online App Development Tools
Sharepoint online'da geliştirme yapılırken gerekli toolların Nuget Console kullanarak otomatik olarak indirilmesi işimizi kolaylaştırmakta. :)
Farm uygulamaları için olan Sharepoint Manager'ın yerini burada Sharepoint Client Browser'a bırakmış bulunuyoruz.
Nuget & Tools
Nuget & Tools
2 Eylül 2015 Çarşamba
SharePoint 2013 – DateControl “Access Denied” (error in '/' application. runtime error)
Sharepoint DateTimeControl açilirken "/_layouts/15/iframe.aspx" frame Url ini kullanmanktadir.
Kesin karşılacaginiz bir problem.
Çözüm:
-On Page load
DateTimeControl dtPicker.DatePickerFrameUrl =ResolveUrl(SPContext.Current.Site.Url + “/_layouts/15/iframe.aspx”);
Veya
dtTarih1.DatePickerFrameUrl =ResolveUrl(SPContext.Current.Site.Url + “/_layouts/15/iframe.aspx”);
Kesin karşılacaginiz bir problem.
Çözüm:
-On Page load
DateTimeControl dtPicker.DatePickerFrameUrl =ResolveUrl(SPContext.Current.Site.Url + “/_layouts/15/iframe.aspx”);
Veya
dtTarih1.DatePickerFrameUrl =ResolveUrl(SPContext.Current.Site.Url + “/_layouts/15/iframe.aspx”);
24 Ağustos 2015 Pazartesi
Sharepoint Read From Csv File to fill SP List By using Site Language (Event Receiver)
Merhaba,
Event Receiver kullanarak Csv file'den okunan verilerin sharepoint listesine eklenmesi için yaptığım basit çalışmayı paylaşmak istedim.
----------------------------------------------------------------------------------------
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
using (SPWeb spWeb = (properties.Feature.Parent as SPWeb))
{
uint languageid = (uint)spWeb.Language;
string filePath;
if (languageid == 1055) //Turkish or not
{
filePath = SPUtility.GetVersionedGenericSetupPath(@"TEMPLATE\LAYOUTS\iso27001\TestTr.csv", 15);
}
else
{
filePath = SPUtility.GetVersionedGenericSetupPath(@"TEMPLATE\LAYOUTS\iso27001\TestEng.csv", 15);
}
SPList myList = spWeb.Lists["listname"];
while ((line = file.ReadLine()) != null)
{
String[] Array = line.ToString().Split('\t');
StreamReader file;
file = new StreamReader(filePath);
SPListItem newEntry = myList.Items.Add();
newEntry["Title"] = Array[0];
newEntry["Test1"] = Array[1];
newEntry["Test2"] = Array[2];
newEntry["Test3"] = Array[3];
newEntry.Update();
myList.Update();
}
file.Close();
file.Dispose();
}
}
Event Receiver kullanarak Csv file'den okunan verilerin sharepoint listesine eklenmesi için yaptığım basit çalışmayı paylaşmak istedim.
----------------------------------------------------------------------------------------
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
using (SPWeb spWeb = (properties.Feature.Parent as SPWeb))
{
uint languageid = (uint)spWeb.Language;
string filePath;
if (languageid == 1055) //Turkish or not
{
filePath = SPUtility.GetVersionedGenericSetupPath(@"TEMPLATE\LAYOUTS\iso27001\TestTr.csv", 15);
}
else
{
filePath = SPUtility.GetVersionedGenericSetupPath(@"TEMPLATE\LAYOUTS\iso27001\TestEng.csv", 15);
}
SPList myList = spWeb.Lists["listname"];
while ((line = file.ReadLine()) != null)
{
String[] Array = line.ToString().Split('\t');
StreamReader file;
file = new StreamReader(filePath);
SPListItem newEntry = myList.Items.Add();
newEntry["Title"] = Array[0];
newEntry["Test1"] = Array[1];
newEntry["Test2"] = Array[2];
newEntry["Test3"] = Array[3];
newEntry.Update();
myList.Update();
}
file.Close();
file.Dispose();
}
}
19 Şubat 2015 Perşembe
9 Şubat 2015 Pazartesi
Google Api OpenWeatherMap 7 Days Weather Condition Asp.net
Weather Conditıon Read From OpenWeatherMap XML.
private void getWeather()
{
XmlDocument doc1 = new XmlDocument();
doc1.Load("http://api.openweathermap.org/data/2.5/forecast/daily?q=izmir&mode=xml&units=metric&cnt=7");
XmlElement root = doc1.DocumentElement;
XmlNodeList timenodes = root.SelectNodes("/weatherdata");
XmlNodeList nodes = root.SelectNodes("/weatherdata/forecast/time");
foreach (XmlNode node in nodes)
{
string time = node.Attributes["day"].InnerText;
string condition = node.SelectSingleNode("symbol").Attributes["name"].InnerText;
string precipitation = node.SelectSingleNode("precipitation").Attributes["type"].InnerText;
string windDeg = node.SelectSingleNode("windDirection").Attributes["deg"].InnerText;
string windDirection = node.SelectSingleNode("windDirection").Attributes["name"].InnerText;
string windSpeed = node.SelectSingleNode("windSpeed").Attributes["mps"].InnerText;
string windCondition = node.SelectSingleNode("windSpeed").Attributes["name"].InnerText;
string tempday = node.SelectSingleNode("temperature").Attributes["day"].InnerText;
string tempmin = node.SelectSingleNode("temperature").Attributes["min"].InnerText;
string tempmax = node.SelectSingleNode("temperature").Attributes["max"].InnerText;
string tempnight = node.SelectSingleNode("temperature").Attributes["night"].InnerText;
string tempeve = node.SelectSingleNode("temperature").Attributes["eve"].InnerText;
string tempmorn = node.SelectSingleNode("temperature").Attributes["morn"].InnerText;
string humidityVal = node.SelectSingleNode("humidity").Attributes["value"].InnerText + node.SelectSingleNode("humidity").Attributes["unit"].InnerText;
string cloudval = node.SelectSingleNode("clouds").Attributes["value"].InnerText;
string cloudPercent = node.SelectSingleNode("clouds").Attributes["all"].InnerText + node.SelectSingleNode("clouds").Attributes["unit"].InnerText;
}
}
private void getWeather()
{
XmlDocument doc1 = new XmlDocument();
doc1.Load("http://api.openweathermap.org/data/2.5/forecast/daily?q=izmir&mode=xml&units=metric&cnt=7");
XmlElement root = doc1.DocumentElement;
XmlNodeList timenodes = root.SelectNodes("/weatherdata");
XmlNodeList nodes = root.SelectNodes("/weatherdata/forecast/time");
foreach (XmlNode node in nodes)
{
string time = node.Attributes["day"].InnerText;
string condition = node.SelectSingleNode("symbol").Attributes["name"].InnerText;
string precipitation = node.SelectSingleNode("precipitation").Attributes["type"].InnerText;
string windDeg = node.SelectSingleNode("windDirection").Attributes["deg"].InnerText;
string windDirection = node.SelectSingleNode("windDirection").Attributes["name"].InnerText;
string windSpeed = node.SelectSingleNode("windSpeed").Attributes["mps"].InnerText;
string windCondition = node.SelectSingleNode("windSpeed").Attributes["name"].InnerText;
string tempday = node.SelectSingleNode("temperature").Attributes["day"].InnerText;
string tempmin = node.SelectSingleNode("temperature").Attributes["min"].InnerText;
string tempmax = node.SelectSingleNode("temperature").Attributes["max"].InnerText;
string tempnight = node.SelectSingleNode("temperature").Attributes["night"].InnerText;
string tempeve = node.SelectSingleNode("temperature").Attributes["eve"].InnerText;
string tempmorn = node.SelectSingleNode("temperature").Attributes["morn"].InnerText;
string humidityVal = node.SelectSingleNode("humidity").Attributes["value"].InnerText + node.SelectSingleNode("humidity").Attributes["unit"].InnerText;
string cloudval = node.SelectSingleNode("clouds").Attributes["value"].InnerText;
string cloudPercent = node.SelectSingleNode("clouds").Attributes["all"].InnerText + node.SelectSingleNode("clouds").Attributes["unit"].InnerText;
}
}
Kaydol:
Kayıtlar (Atom)