homepage Welcome to WebmasterWorld Guest from 54.167.11.16
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Query about Labels and H1 Tags in VB.NET
quick question.
kolin




msg:3131931
 4:58 pm on Oct 23, 2006 (gmt 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

 

mattglet




msg:3131991
 5:49 pm on Oct 23, 2006 (gmt 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>"

sharbel




msg:3132411
 12:36 am on Oct 24, 2006 (gmt 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...

Easy_Coder




msg:3132422
 12:45 am on Oct 24, 2006 (gmt 0)

Why not just do this?

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

kolin




msg:3132776
 10:11 am on Oct 24, 2006 (gmt 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.

venton




msg:3133232
 4:00 pm on Oct 24, 2006 (gmt 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

Jimmy Turnip




msg:3135464
 11:55 am on Oct 26, 2006 (gmt 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]

Easy_Coder




msg:3136235
 12:21 am on Oct 27, 2006 (gmt 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.

carguy84




msg:3136500
 6:19 am on Oct 27, 2006 (gmt 0)

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

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

Easy_Coder




msg:3137385
 7:08 pm on Oct 27, 2006 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved