How to Write dynamic page title, Meata Keyword, Meta Description

Posted by Vanchi050585 under Regular Expressions on 3/21/2011 | Points: 10 | Views : 6793 | Status : [Member] | Replies : 5
hi All,

How to Write dynamic page title, Meata Keyword, Meta Description

if anybody know please tell the coding

Thanks in Advance

Thanks
tvn



Responses

Posted by: Prabhakar on: 3/21/2011 [Member] [MVP] Starter | Points: 25

Up
0
Down

hi ,Vanchi050585

i am not understand ur requirement Dynamic Title ... and about meta data code is here



<META NAME="KEYWORDS" CONTENT="your keywords,go here,separated by a comma,but not a space">


<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />


Best Regard's
Prabhakar

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhu.b.rokkam on: 3/21/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Refer this link

http://weblogs.asp.net/fmarguerie/archive/2003/11/09/36546.aspx

to Add your page title dinamically.

Thanks and Regards
Madhu

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Madhu.b.rokkam on: 3/21/2011 [Member] [MVP] Bronze | Points: 25

Up
0
Down
Create an instance of HtmlMeta class and add the details as needed.

HtmlMeta meta = new HtmlMeta();
meta.Name = "Your Description Here";
meta.Content = "Here your custom meta description tag";
head.Controls.Add(meta);


Thanks and Regards
Madhu

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mesh_2010 on: 3/22/2011 [Member] Starter | Points: 25

Up
0
Down

Hi,

you can use this code in .cs file access data in databse dynamic

SqlDataReader SDR;

if (SDR.HasRows)
{
SDR.Read();
mSeoTitle = SDR["Title"].ToString();
mSeoDesc = SDR["searchEngineDesc"].ToString();
mSeoKeyword = SDR["Keywords"].ToString();
SDR.Close();
HtmlMeta description = new HtmlMeta();
description.Name = "description";
description.Content = mSeoDesc;
Page.Header.Controls.Add(description);

HtmlMeta keywords = new HtmlMeta();
keywords.Name = "keywords";
keywords.Content = mSeoKeyword;
Page.Header.Controls.Add(keywords);

Page.Title = mSeoTitle;
}
else
{
SDR.Close();
}

Thanks
RameSH sinGH

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: SheoNarayan on: 3/22/2011 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
In ASP.NET 4.0, its easy. Just go to code behind and set these properties

this.MetaDescription = " Your page description";

this.MetaKeywords = "Your comma separated keywords";
this.Title = "Your page titile";


Thanks

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Vanchi050585, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response