try
{
SPWeb curentWeb = SPControl.GetContextWeb(Context);
SPList lst = curentWeb.Lists["Telno"];
SPQuery sQuery = new SPQuery();
sQuery.Query = "<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>" + txtFname.Text.ToString().ToLower() + "</Value></Eq></Where>";
SPListItemCollection myColl = lst.GetItems(sQuery);
if (myColl.Count > 0)
{
strError += "<Script Language='JavaScript' type='JavaScript'>";
strError += "alert('Friend Name Already Available');";
strError += "</Script>";
}
else
{
strError += "<Script Language='JavaScript' type='JavaScript'>";
strError += "alert('Friend Name Not Available');";
strError += "</Script>";
}
}
catch (Exception ex)
{
strError += ex.ToString();
}
{
SPWeb curentWeb = SPControl.GetContextWeb(Context);
SPList lst = curentWeb.Lists["Telno"];
SPQuery sQuery = new SPQuery();
sQuery.Query = "<Where><Eq><FieldRef Name='Title' /><Value Type='Text'>" + txtFname.Text.ToString().ToLower() + "</Value></Eq></Where>";
SPListItemCollection myColl = lst.GetItems(sQuery);
if (myColl.Count > 0)
{
strError += "<Script Language='JavaScript' type='JavaScript'>";
strError += "alert('Friend Name Already Available');";
strError += "</Script>";
}
else
{
strError += "<Script Language='JavaScript' type='JavaScript'>";
strError += "alert('Friend Name Not Available');";
strError += "</Script>";
}
}
catch (Exception ex)
{
strError += ex.ToString();
}
No comments:
Post a Comment