troubleshooting Question

Need help with Meta Tags positioning

Avatar of CementTruck
CementTruck asked on
ASP.NETSearch Engine Optimization (SEO)Web Development.NET ProgrammingHTML
3 Comments1 Solution162 ViewsLast Modified:
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
ASKER CERTIFIED SOLUTION
Bernard Savonet
CIO

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros