Search - Articles
DevASP.NET for ASP.NET, VB.NET, XML and C# (C-Sharp) Developers Tuesday, March 03, 2009
Dev Articles
Search Directory
ASP.NET
VB.Net
C-Sharp
SQL Server
 

FREE 12 month online training for ASP.NET & MS Expression Studio and a Free copy of MS Expression Web with Windows Server Purchase
Create a Meta tags Generator Using C#

Author: DevASP
Download Source Code : 472_MetatagsGenerator.zip

Meta-tags are used frequently by most search engines. They identify your website content using your meta-tags. This simple tool will allow you to configure them easily!

Create a new ASP.Net application using C#, and drag five text boxes, a button and 7 label controls. Meta-tags are used by search engines so that they identify the website content. In order to generate a meta tags you have to get the following information:

  • Website Title
  • Website Description
  • Website Keywords
  • Website Author

Get this informtion using textbox control, set the IDof the textboxes as:

  • txttittle: to get the information about Website Title
  • txtdes: to get the information about Website Description
  • txtkey: to get the information about Website Keywords
  • txtauth: to get the information about Website Author name

Now write the following code on the button click event:

private void Button1_Click(object sender, System.EventArgs e)

{

bool er = false;

if(txttittle.Text=="" )

{

txtresult.Text = "Please Enter Tittle";

er = true;

}

if(txtdes.Text=="" )

{

txtresult.Text = "Please Enter Description";

er = true;

}

if(txtkey.Text=="" )

{

txtresult.Text = "Please Enter Keywrods";

er = true;

}

if(txtauth.Text=="" )

{

txtresult.Text = "Please Enter Author";

er = true;

}

if(er==false)

txtresult.Text = "<head>" + '\r' +'\n' +"<title>"+txttittle.Text+"</title>"+'\r' +'\n'+"<meta name=\"description\" content=\""+txtdes.Text+ "\">"+ '\r' +'\n' +

"<meta name=\"keywords\" content=\""+txtkey.Text+ "\">"+ '\r' +'\n' +

"<meta name=\"author\" content=\""+txtauth.Text+ "\">"+ '\r' +'\n' +"</head>";

}

   
Add Article Comment:
Name :
Email Address :
   
Comments :
 
   
<< Get Browser Detail of Client Using C#

Disclaimer - Privacy
© 2002-2012 DevASP.net