Tuesday, May 18, 2010
check folder / directory is exist or not...
check folder / directory is exist or not...
Monday, May 3, 2010
Split a path into a string[] in C# .net
Saturday, May 1, 2010
Add/Change Page Meta tags dynamically in asp.net using C#.
Meta tags are very much important for you web page, search engine use
Create a web application in c#
Drag a button and one textbox on the form
Then write code on form load event
C#
protected void Page_Load(object sender, EventArgs e)
{
HtmlHead headTag = (HtmlHead)this.Header;
// Set the page title
headTag.Title = "Title of Page";
// Add a Description meta tag
HtmlMeta PagemetaTag = new HtmlMeta();
PagemetaTag.Name = "Description";
PagemetaTag.Content = "Customized Description tag of the page";
headTag.Controls.Add(PagemetaTag);
// Add a Keywords meta tag
PagemetaTag = new HtmlMeta();
PagemetaTag.Name = "Keywords";
PagemetaTag.Content = "Customized Keyword tag of the page";
headTag.Controls.Add(PagemetaTag);
}
VB
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Dim headTag As HtmlHead = CType(Me.Header, HtmlHead)
' Set the page title
headTag.Title = "Title of Page"
' Add a Description meta tag
Dim PagemetaTag As HtmlMeta = New HtmlMeta()
PagemetaTag.Name = "Description"
PagemetaTag.Content = "Customized Description tag of the page"
headTag.Controls.Add(PagemetaTag)
' Add a Keywords meta tag
PagemetaTag = New HtmlMeta()
PagemetaTag.Name = "Keywords"
PagemetaTag.Content = "Customized Keyword tag of the page"
headTag.Controls.Add(PagemetaTag)
End Sub
This is the simple code to change meta tags of your page dynamically.