asp.net MVC3 auto generate meta keywords and description based on page content -


i'm working on mvc3 web application using razor view engine. i'm looking solution generate meta keywords , description automatically on pages.

i've found this solution here on stackoverflow, idea looking good. since i'm planning post blogs etc... on website want meta keywords , description auto generated based on content of page.

soo far i've got following things in mind. let's current html looks below;

   <html>     <head>     </head>         <body>             <header></header>             <div id="container">                 <div id="sidebar"></div>                 <div id="pageheader"></div>                 <div id="content">                     <!--this part contains dynamic content-->                 </div>                 <div class="clear"></div>             </div>             <footer></footer>         </body>     </html> 

the desired situation me below;

   <html>     <head>         @html.metakeywords()         @html.metadescription()     </head>         <body>             <header></header>             <div id="container">                 <div id="sidebar"></div>                 <div id="pageheader"></div>                 <div id="content">                     <!--this part contains dynamic content-->                 </div>                 <div class="clear"></div>             </div>             <footer></footer>         </body>     </html> 

said i've got following questions left unanswered, hope can help.

  1. the situation described above, html-helpers. , logic approach generate keywords , description on every single page, based on content?
  2. if is, has experience , maybe example?
  3. if not, there other options? other using attribute on each controller action? still option, doesn't generate keywords description based on page content.

i hope can me out. thanks!

if i'm understanding correctly, want able auto generate metadata based on text inside content div?

i try passing text / html / model metakeywords , metadescription functions, , allowing them parse / analyze / look-up information need put in metadata.

   <html>     <head>         @html.metakeywords(model.contenttext)         @html.metadescription(model.contenttext)     </head>         <body>             <header></header>             <div id="container">                 <div id="sidebar"></div>                 <div id="pageheader"></div>                 <div id="content">                     <!--this part contains dynamic content-->                 </div>                 <div class="clear"></div>             </div>             <footer></footer>         </body>     </html> 

Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -