Click here to Skip to main content
15,884,679 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi,
I am having facebook share button in my website. i couldn't find any code to do that properly.So i am trying to use by meta tags preferred by many websites.But as a fresher i don't know how to call my database values into my meta tags.please anybody help me to solve the problem

Posted

Hi here you can add it by code in c#
You need to just fetch value for proper metatag.
FOr example i have created robots meta tag and value noindex,follow is taking from database.


HtmlMeta meta = new HtmlMeta();

meta.Name = "robots";

meta.Content = "noindex,follow";

this.Page.Header.Controls.Add(meta);
 
Share this answer
 
Comments
RamaDinakaran 26-Dec-13 4:49am    
Ithere a code i have to write for "follow" or just i have to write follow in my code.
HtmlMeta keywords = new HtmlMeta();

keywords.Name = "keywords"; // Your Meta Tag Name

keywords.Content = Retrieve your meta tag name from database

Header.Controls.Add(keywords);
 
Share this answer
 
Comments
RamaDinakaran 26-Dec-13 4:47am    
can u send me any example how to retrieve data from database for meta tags..
DataTable dt;
dt = this.objmetaTagBAL.getMetaTag(); // Selecting Meta tag from database
HtmlMeta keywords = new HtmlMeta();
keywords.Content = dt.Rows[0][1].ToString() ;
Header.Controls.Add(keywords);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900