Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
I am Developing a news application, in which i want to display IN PAGE SOURCE the meta title, keyword ,key phrase, description.So tell me how to implement this in the application..

What I have tried:

I have no idea to implement this..
Posted
Updated 15-Apr-16 20:33pm
Comments
johannesnestler 14-Apr-16 7:36am    
if you question yourself why you don't get answers to your question - I can answer that! - learn to ask questions first!
read http://www.codeproject.com/KB/FAQs/QuickAnswersFAQ.aspx
[no name] 15-Apr-16 5:53am    
Are you using ASP.NET MVC or WebForms?
kumarravishankar 16-Apr-16 0:44am    
I am usinf WebForms..
[no name] 16-Apr-16 15:52pm    
You can use Page.Title = "My Title"; for the title meta tag. Anil's solution below works well for the other meta tags.

1 solution

1)you can add web form directyly in header tag web from
<mata name="Description" content="bla bla">
2)secondly code behind page
C#
/Page description
  //Page 
        HtmlMeta Desc = new HtmlMeta();
        Desc.Name = "Description";
        Desc.Content = "Abc";
        Header.Controls.Add(Desc);
        //page keywords
        HtmlMeta keywords = new HtmlMeta();
        keywords.Name = "keywords";
        keywords.Content = "asp.net,C#.NET";
        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