Need help with Meta Tags positioning

I have a master page with meta tags. When doing a view source the meta tags appear in sequential order like there is a carraige return or break tag between them.

I have some pages that require me to change the metadescrpition and metakeywords and I do that on the code behind of the actual product page (see code sample below). On page where the codebehind changes the meta tag info the meta tags run together and are hard to read. How do I get the carriage return visual back?

If it's relevant, main page is .aspx, codebehind is .vb

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        DirectCast(Master.FindControl("metadescription"), HtmlControl).Attributes("content") = "Some Text here"
        DirectCast(Master.FindControl("metakeywords"), HtmlControl).Attributes("content") = "More Text Here"
        Page.Title = "Title info here"

    End Sub

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bernard SavonetCIOCommented:
- Your problem is "just" in source code display, where you have problem reading all your keywords (or more generally long lines in html)

- This might be considered as a problem in your program. However, if it is fine for search engines, it is ok for your program.

- My suggestion: ask for source code display, the select all this text, copy it, and paste it in a simple text editor (not word processing).
Not sure if you run Windows, Mac or some linux. In windows, that would be:
-- display the page in your browser
-- open NotePad, check that in "Format" , you have ticked "automatic line return"
-- display source code
-- select all (ctrl-A), copy (ctrl-c)
-- click inside notepad, then paste (ctrl-v)
Your text should now be visible entirely

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CementTruckAuthor Commented:

Thanks for your response.

At first I thought there was something wrong with my code then someone told me that because it was rewritten programmatically on the codebehind page that it was then rewritten with an eye towards space conservation. There isn't anything wrong with my code.

I was already using notepad in exactly the way you mentioned. I'm working on a large project with many pages on a public facing site and I can't quickly do a view source to check my work.
Bernard SavonetCIOCommented:
B-) glad to help. Thx for the grade and points!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.