http://interviews.c-sharpcorner.com/Default.aspx
username: som.rajat
password: rajat314
Thursday, January 7, 2010
Thursday, July 16, 2009
Dynamically set Pagetitle,meta tags
when master page has "head content place holder"
then each page has head content place holder
then use this code:
Page.Header.Title = "Houses to rent in Birmingham, Student accommodation ";
HtmlMeta tagDescription = new HtmlMeta();
tagDescription.Name = "Description";
tagDescription.Content = "EzeeHOME ";
Header.Controls.Add(tagDescription);
HtmlMeta tagKeywords = new HtmlMeta();
tagKeywords.Name = "Keywords";
tagKeywords.Content = "Student ";
Header.Controls.Add(tagKeywords);
then each page has head content place holder
then use this code:
Page.Header.Title = "Houses to rent in Birmingham, Student accommodation ";
HtmlMeta tagDescription = new HtmlMeta();
tagDescription.Name = "Description";
tagDescription.Content = "EzeeHOME ";
Header.Controls.Add(tagDescription);
HtmlMeta tagKeywords = new HtmlMeta();
tagKeywords.Name = "Keywords";
tagKeywords.Content = "Student ";
Header.Controls.Add(tagKeywords);
Tuesday, May 26, 2009
Delegates Study
http://www.akadia.com/services/dotnet_delegates_and_events.html
http://www.c-sharpcorner.com/UploadFile/Ashush/Delegates02152008155757PM/Delegates.aspx
http://www.codersource.net/csharp_delegates_events.html
http://www.developerfusion.com/article/3057/events-and-delegates/
http://www.csharp-station.com/Tutorials/lesson14.aspx
http://www.c-sharpcorner.com/UploadFile/Ashush/Delegates02152008155757PM/Delegates.aspx
http://www.codersource.net/csharp_delegates_events.html
http://www.developerfusion.com/article/3057/events-and-delegates/
http://www.csharp-station.com/Tutorials/lesson14.aspx
Monday, May 11, 2009
Radio button in Repeater Control Issue
Only one radio button should be checked.
Solution
http://stackoverflow.com/questions/290018/how-to-find-checked-radiobutton-inside-repeater-item
For Fixing the Issue
http://www.codeguru.com/csharp/csharp/cs_controls/custom/article.php/c12371/
Solution
http://stackoverflow.com/questions/290018/how-to-find-checked-radiobutton-inside-repeater-item
For Fixing the Issue
http://www.codeguru.com/csharp/csharp/cs_controls/custom/article.php/c12371/
Wednesday, April 22, 2009
Share Point Tutorial
http://searchwindevelopment.techtarget.com/generic/0,295582,sid8_gci1274280,00.html
http://www.cmswire.com/cms/cms-reviews/sharepoint-2007-review-six-pillars-of-moss-000922.php
http://www.cmswire.com/cms/cms-reviews/sharepoint-2007-review-six-pillars-of-moss-000922.php
Speed Up site/Code Optimization
http://msdn.microsoft.com/en-us/magazine/cc163901.aspx
http://dotnetslackers.com/articles/aspnet/ImproveWebApplicationPerformance.aspx
http://dotnetslackers.com/articles/aspnet/ImproveWebApplicationPerformance.aspx
Saturday, March 28, 2009
Find Slang Word and Highlight Them
Xml File :XMLAbuseFile.xml
"NewDataSet"
"tblGeneric"
"UTLName" toy "UTLName"
"/tblGeneric"
"tblGeneric"
"UTLName" utl "/UTLName"
"/tblGeneric"
"tblGeneric"
"UTLName" go "UTLName"
"/tblGeneric"
"/NewDataSet"
Class Module : clsSlangWord.cs
Namespace :
using System.Xml;
using System.Xml.XPath;
using System.Text.RegularExpressions;
using System.Text;
#region Find and HighLight Slang Word
public static string GetslangWord(string strInfo)
{
StringBuilder objsb = new StringBuilder();
XPathDocument doc = new XPathDocument(HttpContext.Current.Server.MapPath("UploadedFiles/XMLFIle/XMLAbuseFile.xml"));
XPathNavigator nav = doc.CreateNavigator();
// Compile a standard XPath expression
XPathExpression expr;
string[] strInfoArr = strInfo.Trim().Split(' ');
for (int arr = 0; arr < strInfoArr.Length; arr++)
{
expr = nav.Compile("/NewDataSet/tblGeneric[UTLName='" + strInfoArr[arr].ToString().ToLower() + "']");
XPathNodeIterator iterator = nav.Select(expr);
// Iterate on the node set
while (iterator.MoveNext())
{
XPathNavigator nav2 = iterator.Current.Clone();
if (strInfoArr[arr].ToString().ToLower() == nav2.Value.ToString().ToLower())
{
objsb.Append(strInfoArr[arr].ToString());
objsb.Append(" ");
}
}
}
return objsb.ToString();
}
public static string ReplaceSlang(string strSlangWord, string strInfo)
{
string[] strSlangArr = strSlangWord.Trim().Split(' ');
string strInputInfo = strInfo;
if (strInputInfo.Length > 0)
{
for (int arr = 0; arr < strSlangArr.Length; arr++)
{
strInputInfo = strInputInfo.Replace(strSlangArr[arr].ToString(), "*");
}
}
return strInputInfo;
}
public static string HighLightSlangWord(string strSlangWord, string strInfo)
{
string[] strSlangArr = strSlangWord.Trim().Split(' ');
string strInputInfo = strInfo;
if (strInputInfo.Length > 0)
{
for (int arr = 0; arr < strSlangArr.Length; arr++)
{
strInputInfo = Highlight(strSlangArr[arr], strInputInfo);
}
}
return strInputInfo;
}
//Highlight(txtSearchKeyword.Value, str_FullText)
public static string Highlight(string Search_Str, string InputTxt)
{
// Setup the regular expression and add the Or operator.
Regex reg = new Regex("[^A-Za-z0-9]");
Search_Str = reg.Replace(Search_Str, " ");
Regex RegExp = new Regex(Search_Str.Replace(" ", "|").Trim(), RegexOptions.IgnoreCase);
// Highlight keywords by calling the delegate each time a keyword is found.
// return RegExp.Replace(InputTxt, new MatchEvaluator(ReplaceKeyWords));
string sret = RegExp.Replace(InputTxt, new MatchEvaluator(ReplaceKeyWords));
return sret;
// Set the RegExp to null.
RegExp = null;
}
public static string ReplaceKeyWords(Match m)
{
return "" + m.Value + "";
return "span style='background-color: #ffff00'" + m.Value + "/span";
}
#endregion
Page Code : cs file
protected string strSlangWordCollection = "";
private Boolean ManageSlangWord()
{
bool Flag = false;
string strInputInfo = FCKeditorDecs.Value.Trim();
strInputInfo = Regex.Replace(strInputInfo, "<.*?>", string.Empty);
if (strInputInfo != "")
{
string strSlangWord = clsSlangWord.GetslangWord(strInputInfo);
if (strSlangWord.Length > 0)
{
//string strReplaceSlangWord = ReplaceSlang(strSlangWord, strName);
strSlangWordCollection = strSlangWordCollection + " " + strSlangWord;
string strHighlightSlangWord = clsSlangWord.HighLightSlangWord(strSlangWord, strInputInfo);
//txtName.Text = strHighlightSlangWord;
//lbl.Text = strHighlightSlangWord;
FCKeditorDecs.Value = strHighlightSlangWord;
Flag = true;
}
}
return Flag;
}
Btn Submit Code:
bool Flag = false;
msg_Slang.InnerHtml = "";
if (Convert.ToString(Session["UserID"]) != "")
{
Flag = ManageSlangWord();
if (Flag == false)
{
ManageComments();
}
else
{
msg_Slang.InnerHtml = "You can't use these slang words '" + strSlangWordCollection + " '";
}
}
"NewDataSet"
"tblGeneric"
"UTLName" toy "UTLName"
"/tblGeneric"
"tblGeneric"
"UTLName" utl "/UTLName"
"/tblGeneric"
"tblGeneric"
"UTLName" go "UTLName"
"/tblGeneric"
"/NewDataSet"
Class Module : clsSlangWord.cs
Namespace :
using System.Xml;
using System.Xml.XPath;
using System.Text.RegularExpressions;
using System.Text;
#region Find and HighLight Slang Word
public static string GetslangWord(string strInfo)
{
StringBuilder objsb = new StringBuilder();
XPathDocument doc = new XPathDocument(HttpContext.Current.Server.MapPath("UploadedFiles/XMLFIle/XMLAbuseFile.xml"));
XPathNavigator nav = doc.CreateNavigator();
// Compile a standard XPath expression
XPathExpression expr;
string[] strInfoArr = strInfo.Trim().Split(' ');
for (int arr = 0; arr < strInfoArr.Length; arr++)
{
expr = nav.Compile("/NewDataSet/tblGeneric[UTLName='" + strInfoArr[arr].ToString().ToLower() + "']");
XPathNodeIterator iterator = nav.Select(expr);
// Iterate on the node set
while (iterator.MoveNext())
{
XPathNavigator nav2 = iterator.Current.Clone();
if (strInfoArr[arr].ToString().ToLower() == nav2.Value.ToString().ToLower())
{
objsb.Append(strInfoArr[arr].ToString());
objsb.Append(" ");
}
}
}
return objsb.ToString();
}
public static string ReplaceSlang(string strSlangWord, string strInfo)
{
string[] strSlangArr = strSlangWord.Trim().Split(' ');
string strInputInfo = strInfo;
if (strInputInfo.Length > 0)
{
for (int arr = 0; arr < strSlangArr.Length; arr++)
{
strInputInfo = strInputInfo.Replace(strSlangArr[arr].ToString(), "*");
}
}
return strInputInfo;
}
public static string HighLightSlangWord(string strSlangWord, string strInfo)
{
string[] strSlangArr = strSlangWord.Trim().Split(' ');
string strInputInfo = strInfo;
if (strInputInfo.Length > 0)
{
for (int arr = 0; arr < strSlangArr.Length; arr++)
{
strInputInfo = Highlight(strSlangArr[arr], strInputInfo);
}
}
return strInputInfo;
}
//Highlight(txtSearchKeyword.Value, str_FullText)
public static string Highlight(string Search_Str, string InputTxt)
{
// Setup the regular expression and add the Or operator.
Regex reg = new Regex("[^A-Za-z0-9]");
Search_Str = reg.Replace(Search_Str, " ");
Regex RegExp = new Regex(Search_Str.Replace(" ", "|").Trim(), RegexOptions.IgnoreCase);
// Highlight keywords by calling the delegate each time a keyword is found.
// return RegExp.Replace(InputTxt, new MatchEvaluator(ReplaceKeyWords));
string sret = RegExp.Replace(InputTxt, new MatchEvaluator(ReplaceKeyWords));
return sret;
// Set the RegExp to null.
RegExp = null;
}
public static string ReplaceKeyWords(Match m)
{
return "" + m.Value + "";
return "span style='background-color: #ffff00'" + m.Value + "/span";
}
#endregion
Page Code : cs file
protected string strSlangWordCollection = "";
private Boolean ManageSlangWord()
{
bool Flag = false;
string strInputInfo = FCKeditorDecs.Value.Trim();
strInputInfo = Regex.Replace(strInputInfo, "<.*?>", string.Empty);
if (strInputInfo != "")
{
string strSlangWord = clsSlangWord.GetslangWord(strInputInfo);
if (strSlangWord.Length > 0)
{
//string strReplaceSlangWord = ReplaceSlang(strSlangWord, strName);
strSlangWordCollection = strSlangWordCollection + " " + strSlangWord;
string strHighlightSlangWord = clsSlangWord.HighLightSlangWord(strSlangWord, strInputInfo);
//txtName.Text = strHighlightSlangWord;
//lbl.Text = strHighlightSlangWord;
FCKeditorDecs.Value = strHighlightSlangWord;
Flag = true;
}
}
return Flag;
}
Btn Submit Code:
bool Flag = false;
msg_Slang.InnerHtml = "";
if (Convert.ToString(Session["UserID"]) != "")
{
Flag = ManageSlangWord();
if (Flag == false)
{
ManageComments();
}
else
{
msg_Slang.InnerHtml = "You can't use these slang words '" + strSlangWordCollection + " '";
}
}
Subscribe to:
Comments (Atom)