Asp – updating dynamic meta tag – asp.net

asp.netmeta-tags

The master page contains two pieces – .ascx control to hold meta information and this aspx page. The aspx page queries database (based on some URL parameter) and determines that the current database piece to display is x, and the display-name of x is y. ( All with the help of database).

Now, the meta tag should contain y as one of the keywords. I feel it would be too late if I set this up in the aspx page, because meta data is already generated by then.

What other options do I have? My meta control could query the database itself, but I would be querying database twice for the same information?

Please do not tell me how meta keywords are totally useless. That is not my part of the job. I am just told to integrate this thing in.

Best Answer

Can you create a public property on the meta control that holds a collection of keywords? You can add to that collection when you go off to get your data the first time, then have the meta control render any values that are present in the collection.

Related Topic