ASP Control names in resulting HTML

Discussion in 'ASP .Net' started by Anatoli Trifonov, Jun 6, 2004.

  1. Hi all

    Please point me to a link if this can be changed, fixed or something

    I have the following control in my UserControl

    <img src="pic/dot.gif" border="0" width="50" height="50"
    id="imgCenterImage" runat="server" alt="">

    After aspx runs through

    imgCenterImage.Src = bla bla bla
    imgCenterImage.Width = iImageWidth
    imgCenterImage.Height = iImageHeight
    imgCenterImage.Alt = bla bla bla

    Result is this in HTML

    <img src="pic/icon_top_how_we_can.gif"
    id="_ctl0_ctrlTopMenu__ctl2_imgCenterImage" border="0" width="95"
    height="72" alt="How We Can Help" />


    Is there any way to control the resulting ID?
    This line
    id="_ctl0_ctrlTopMenu__ctl2_imgCenterImage"
    makes aspx unusable for creation of web sites for search engines

    ID starting with "_" is not allowed in

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    Thanks

    --
    _____________________________________
    Anatoli Trifonov
    Software Developer & Consultant

    Minds are like parachutes - they only function when open.
    --Thomas Dewar
    Anatoli Trifonov, Jun 6, 2004
    #1
    1. Advertising

  2. "Anatoli Trifonov" <> wrote in message
    news:Ogi$aQ%...
    > Hi all
    >
    > Please point me to a link if this can be changed, fixed or something
    >
    > I have the following control in my UserControl
    >
    > <img src="pic/dot.gif" border="0" width="50" height="50"
    > id="imgCenterImage" runat="server" alt="">
    >
    > After aspx runs through
    >
    > imgCenterImage.Src = bla bla bla
    > imgCenterImage.Width = iImageWidth
    > imgCenterImage.Height = iImageHeight
    > imgCenterImage.Alt = bla bla bla
    >
    > Result is this in HTML
    >
    > <img src="pic/icon_top_how_we_can.gif"
    > id="_ctl0_ctrlTopMenu__ctl2_imgCenterImage" border="0" width="95"
    > height="72" alt="How We Can Help" />
    >
    >
    > Is there any way to control the resulting ID?
    > This line
    > id="_ctl0_ctrlTopMenu__ctl2_imgCenterImage"
    > makes aspx unusable for creation of web sites for search engines


    Really? You know of a search engine which chokes on the leading "_"? Please
    tell us which one.

    > ID starting with "_" is not allowed in
    >
    > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


    Your "imgCenterImage" id is being changed because it is inside of some
    control which implements INamingContainer. THat control appears to have a
    defaulted id of "_ctl2". It is inside of "ctlTopMenu", which is inside of
    "_ctl0". You should locate the control which is being called "_ctl0" and
    give it an explicit id.
    --
    John Saunders
    johnwsaundersiii at hotmail
    John Saunders, Jun 6, 2004
    #2
    1. Advertising

  3. Thanks for your help.

    > Really? You know of a search engine which chokes on the leading "_"?

    Please
    > tell us which one.


    What do you mean by "chokes"? Page will be indexed of course.
    Question is how ...


    --
    _____________________________________
    Anatoli Trifonov
    Software Developer & Consultant
    Minds are like parachutes - they only function when open.
    --Thomas Dewar
    "John Saunders" <> wrote in message
    news:%23soIDG$...
    > "Anatoli Trifonov" <> wrote in message
    > news:Ogi$aQ%...
    > > Hi all
    > >
    > > Please point me to a link if this can be changed, fixed or something
    > >
    > > I have the following control in my UserControl
    > >
    > > <img src="pic/dot.gif" border="0" width="50" height="50"
    > > id="imgCenterImage" runat="server" alt="">
    > >
    > > After aspx runs through
    > >
    > > imgCenterImage.Src = bla bla bla
    > > imgCenterImage.Width = iImageWidth
    > > imgCenterImage.Height = iImageHeight
    > > imgCenterImage.Alt = bla bla bla
    > >
    > > Result is this in HTML
    > >
    > > <img src="pic/icon_top_how_we_can.gif"
    > > id="_ctl0_ctrlTopMenu__ctl2_imgCenterImage" border="0" width="95"
    > > height="72" alt="How We Can Help" />
    > >
    > >
    > > Is there any way to control the resulting ID?
    > > This line
    > > id="_ctl0_ctrlTopMenu__ctl2_imgCenterImage"
    > > makes aspx unusable for creation of web sites for search engines

    >
    > Really? You know of a search engine which chokes on the leading "_"?

    Please
    > tell us which one.
    >
    > > ID starting with "_" is not allowed in
    > >
    > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    >
    > Your "imgCenterImage" id is being changed because it is inside of some
    > control which implements INamingContainer. THat control appears to have a
    > defaulted id of "_ctl2". It is inside of "ctlTopMenu", which is inside of
    > "_ctl0". You should locate the control which is being called "_ctl0" and
    > give it an explicit id.
    > --
    > John Saunders
    > johnwsaundersiii at hotmail
    >
    >
    Anatoli Trifonov, Jun 7, 2004
    #3
  4. "Anatoli Trifonov" <> wrote in message
    news:%...
    > Thanks for your help.
    >
    > > Really? You know of a search engine which chokes on the leading "_"?

    > Please
    > > tell us which one.

    >
    > What do you mean by "chokes"? Page will be indexed of course.
    > Question is how ...


    But will there be any difference in how its indexed between a leading "_" in
    the id and no leading "_". In what way will the "_" make a difference?
    --
    John Saunders
    johnwsaundersiii at hotmail
    John Saunders, Jun 7, 2004
    #4
  5. "John Saunders" <> wrote in message
    news:...
    > "Anatoli Trifonov" <> wrote in message
    > news:%...
    > > Thanks for your help.
    > >
    > > > Really? You know of a search engine which chokes on the leading "_"?

    > > Please
    > > > tell us which one.

    > >
    > > What do you mean by "chokes"? Page will be indexed of course.
    > > Question is how ...

    >
    > But will there be any difference in how its indexed between a leading "_"

    in
    > the id and no leading "_". In what way will the "_" make a difference?
    > --
    > John Saunders
    > johnwsaundersiii at hotmail
    >
    >

    If you declare that page uses HTML 4.0 or 4.1 then
    ID="_bla_bla_bla" is not allowed in HTML 4.0 or 4.1.

    I'm under assumption that search engine checks for things like this.

    Anatoli Trifonov
    Anatoli Trifonov, Jun 7, 2004
    #5
  6. "Anatoli Trifonov" <> wrote in message
    news:...
    > "John Saunders" <> wrote in message
    > news:...
    > > "Anatoli Trifonov" <> wrote in message
    > > news:%...
    > > > Thanks for your help.
    > > >
    > > > > Really? You know of a search engine which chokes on the leading "_"?
    > > > Please
    > > > > tell us which one.
    > > >
    > > > What do you mean by "chokes"? Page will be indexed of course.
    > > > Question is how ...

    > >
    > > But will there be any difference in how its indexed between a leading

    "_"
    > in
    > > the id and no leading "_". In what way will the "_" make a difference?
    > > --
    > > John Saunders
    > > johnwsaundersiii at hotmail
    > >
    > >

    > If you declare that page uses HTML 4.0 or 4.1 then
    > ID="_bla_bla_bla" is not allowed in HTML 4.0 or 4.1.
    >
    > I'm under assumption that search engine checks for things like this.


    I think that this would be a false assumption. I can't think of any way in
    which checking for standards compliance would benefit a search engine.
    --
    John Saunders
    johnwsaundersiii at hotmail
    John Saunders, Jun 7, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bjorn Jensen
    Replies:
    2
    Views:
    816
    Bjorn Jensen
    Mar 22, 2005
  2. James Wallace
    Replies:
    0
    Views:
    1,040
    James Wallace
    Oct 17, 2003
  3. Dil via .NET 247

    SHA1 length of resulting hash

    Dil via .NET 247, Aug 4, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    17,922
    Dil via .NET 247
    Aug 4, 2004
  4. VB Programmer

    How get resulting HTML of datagrid

    VB Programmer, Aug 4, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    1,528
    VB Programmer
    Aug 4, 2004
  5. VB Programmer

    How send email of resulting aspx page?

    VB Programmer, Apr 17, 2005, in forum: ASP .Net
    Replies:
    5
    Views:
    759
    VB Programmer
    Apr 19, 2005
Loading...

Share This Page