Welcome to WebmasterWorld Guest from 54.145.117.60

Forum Moderators: ocean10000

Message Too Old, No Replies

Query about Labels and H1 Tags in VB.NET

quick question.

     
4:58 pm on Oct 23, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:July 7, 2006
posts:55
votes: 0


i'm trying to get more H1 tags into my website.

i have some ascx code the has a label that was filled with the product name like this:

<asp:label id="ProductName" Runat="server">

I have then stuck it between <h1> tags like so:

<h1 Class="BBProductTitle"><asp:label id="ProductName" Runat="server"></H1>

The source code then shows:

<H1 class="BBProductTitle"><span id="dnn_ctr431_ProductPage_ProductName">Turquoise Tankini</span></h1>

my question is, are search engines picking this up as a H1 tag, and is the span class affecting it in any way?

Thanks

5:49 pm on Oct 23, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Nov 12, 2002
posts:1482
votes: 0


I don't have an answer to your SE question, but if you're absolutely worried about it you change the Label to a Literal and have this as your product name (in your code-behind):

ProductName.Text = "<h1 Class=""BBProductTitle"">" & ProductNameVariable & "</h1>"

12:36 am on Oct 24, 2006 (gmt 0)

Full Member

10+ Year Member

joined:Apr 27, 2003
posts:236
votes: 0


Like the above poster, i am not 100% sure it matter either, however you *are* using the wrong server control IMHO. A Label inherits from WebControl so that you have all the styling and formatting options that WebControl offers (bleh). Your situation is better served with a Literal control which inherits from Control (lighter weight with none of the fancy (and useless) styling options of WebControl. Moreover, Literal controls do not wrap the Text property in a Span the way a Label does...
12:45 am on Oct 24, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 2, 2003
posts:1184
votes: 0


Why not just do this?

<h1 Class="BBProductTitle" Runat="Server"></H1>

10:11 am on Oct 24, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:July 7, 2006
posts:55
votes: 0


i'm editting the source code of an existing VB.Net implemented E-Commerce software, in order to customise it, so i'm trying to remove a lot of the 'Shrapnel' that appears, as well as code in some SEO techniques that i feel need to be in there.

I would replace with a literal, but i don't really have the time at this point to try and sift through all the code to find where the text value is pulled from.

4:00 pm on Oct 24, 2006 (gmt 0)

New User

10+ Year Member

joined:Dec 1, 2005
posts:15
votes: 0


You could put the <H1> and </H1> tag into the text of the label itself.

It would render as

<span id="dnn_ctr431_ProductPage_ProductName"><h1 class="BBProductTitle">Turquoise Tankini<h1>/span>

This would be better for seo IMO

11:55 am on Oct 26, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Dec 18, 2003
posts:146
votes: 0


venton:
I don't think <span id="dnn_ctr431_ProductPage_ProductName"><h1 class="BBProductTitle">Turquoise Tankini<h1>/span> is valid markup - you shouldn't wrap a block level element (<h1>) in an inline element (<span>).

A literal would be a better idea. You should only have to change the definition in the code.

[edited by: Jimmy_Turnip at 11:56 am (utc) on Oct. 26, 2006]

12:21 am on Oct 27, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 2, 2003
posts:1184
votes: 0


I still don't understand why you just don't run the H1 tag at the server and ditch the span all together. You can fix this in no time at all.
6:19 am on Oct 27, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 13, 2005
posts:1077
votes: 0


Second what Easy_Coder said, but regardless, just use this:

<h1 Class="BBProductTitle"><asp:literal id="ProductName" Runat="server"></H1>

7:08 pm on Oct 27, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 2, 2003
posts:1184
votes: 0


The span is the result of a label control on the front end, so once you adjust the h1 or use the literal (either way)... then just ditch the Label Control.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members