imagemaps

Discussion in 'ASP .Net' started by David, Oct 18, 2005.

  1. David

    David Guest

    Hi all,

    I need to change the URL in an imagemap area tag.

    I have put...

    <area id="MapAreaName" runat="server" coords=....

    Without a reference in codebehind, it doesn't appear to work, so in
    Codebehind, I have written

    protected System.Web.UI.HtmlControls.HtmlGenericControl MapAreaName;

    However, it doesn't appear to be an HtmlGenericControl.

    I was going to try changing the href attribute with the
    Attributes.Remove("href") then Attributes.Add("href", "new location")

    What would it be?

    Best regards,
    Dave Colliver.
    http://www.EdinburghFOCUS.com
    ~~
    http://www.FOCUSPortals.com - Local franchises available
     
    David, Oct 18, 2005
    #1
    1. Advertising

  2. David,

    The HtmlAnchor is normally used for a link <a> and that would have the href
    property. I'm not positive that it will work for you or not but I'd give
    declaring your area tag as that a try.

    Otherwise what happens when you try?

    MapAreaName.Attributes.Add("href", "NewLocation")

    (I don't think you need to remove the href first... It should just be
    replaced by the Add.)


    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer / Programmer

    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzsche
    "David" <> wrote in message
    news:OavSDj$...
    > Hi all,
    >
    > I need to change the URL in an imagemap area tag.
    >
    > I have put...
    >
    > <area id="MapAreaName" runat="server" coords=....
    >
    > Without a reference in codebehind, it doesn't appear to work, so in
    > Codebehind, I have written
    >
    > protected System.Web.UI.HtmlControls.HtmlGenericControl MapAreaName;
    >
    > However, it doesn't appear to be an HtmlGenericControl.
    >
    > I was going to try changing the href attribute with the
    > Attributes.Remove("href") then Attributes.Add("href", "new location")
    >
    > What would it be?
    >
    > Best regards,
    > Dave Colliver.
    > http://www.EdinburghFOCUS.com
    > ~~
    > http://www.FOCUSPortals.com - Local franchises available
    >
    >
     
    S. Justin Gengo, Oct 18, 2005
    #2
    1. Advertising

  3. David

    David Guest

    Hi,

    Thanks for the response...

    I am using the map in a dynamically loaded user control. They way it was
    loading, I couldn't actually see what was happening.

    I built a simple test page, did as you suggested and I got an error. It is
    actually of a type HtmlGenericControl, which is what I had. However, the
    imagemap I had was not xhtml, which didn't have a closing </map> tag.

    So, when I put that in, I now expect it will all work.

    Thanks for your help.

    Best regards,
    Dave Colliver.
    http://www.AshfieldFOCUS.com
    ~~
    http://www.FOCUSPortals.com - Local franchises available
    "S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
    message news:%23bsWVw$...
    > David,
    >
    > The HtmlAnchor is normally used for a link <a> and that would have the
    > href property. I'm not positive that it will work for you or not but I'd
    > give declaring your area tag as that a try.
    >
    > Otherwise what happens when you try?
    >
    > MapAreaName.Attributes.Add("href", "NewLocation")
    >
    > (I don't think you need to remove the href first... It should just be
    > replaced by the Add.)
    >
    >
    > --
    > Sincerely,
    >
    > S. Justin Gengo, MCP
    > Web Developer / Programmer
    >
    > www.aboutfortunate.com
    >
    > "Out of chaos comes order."
    > Nietzsche
    > "David" <> wrote in message
    > news:OavSDj$...
    >> Hi all,
    >>
    >> I need to change the URL in an imagemap area tag.
    >>
    >> I have put...
    >>
    >> <area id="MapAreaName" runat="server" coords=....
    >>
    >> Without a reference in codebehind, it doesn't appear to work, so in
    >> Codebehind, I have written
    >>
    >> protected System.Web.UI.HtmlControls.HtmlGenericControl MapAreaName;
    >>
    >> However, it doesn't appear to be an HtmlGenericControl.
    >>
    >> I was going to try changing the href attribute with the
    >> Attributes.Remove("href") then Attributes.Add("href", "new location")
    >>
    >> What would it be?
    >>
    >> Best regards,
    >> Dave Colliver.
    >> http://www.EdinburghFOCUS.com
    >> ~~
    >> http://www.FOCUSPortals.com - Local franchises available
    >>
    >>

    >
    >
     
    David, Oct 18, 2005
    #3
  4. David,

    Glad you found it!

    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer / Programmer

    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzsche
    "David" <> wrote in message
    news:%23gMD87$...
    > Hi,
    >
    > Thanks for the response...
    >
    > I am using the map in a dynamically loaded user control. They way it was
    > loading, I couldn't actually see what was happening.
    >
    > I built a simple test page, did as you suggested and I got an error. It is
    > actually of a type HtmlGenericControl, which is what I had. However, the
    > imagemap I had was not xhtml, which didn't have a closing </map> tag.
    >
    > So, when I put that in, I now expect it will all work.
    >
    > Thanks for your help.
    >
    > Best regards,
    > Dave Colliver.
    > http://www.AshfieldFOCUS.com
    > ~~
    > http://www.FOCUSPortals.com - Local franchises available
    > "S. Justin Gengo" <justin@[no_spam_please]aboutfortunate.com> wrote in
    > message news:%23bsWVw$...
    >> David,
    >>
    >> The HtmlAnchor is normally used for a link <a> and that would have the
    >> href property. I'm not positive that it will work for you or not but I'd
    >> give declaring your area tag as that a try.
    >>
    >> Otherwise what happens when you try?
    >>
    >> MapAreaName.Attributes.Add("href", "NewLocation")
    >>
    >> (I don't think you need to remove the href first... It should just be
    >> replaced by the Add.)
    >>
    >>
    >> --
    >> Sincerely,
    >>
    >> S. Justin Gengo, MCP
    >> Web Developer / Programmer
    >>
    >> www.aboutfortunate.com
    >>
    >> "Out of chaos comes order."
    >> Nietzsche
    >> "David" <> wrote in message
    >> news:OavSDj$...
    >>> Hi all,
    >>>
    >>> I need to change the URL in an imagemap area tag.
    >>>
    >>> I have put...
    >>>
    >>> <area id="MapAreaName" runat="server" coords=....
    >>>
    >>> Without a reference in codebehind, it doesn't appear to work, so in
    >>> Codebehind, I have written
    >>>
    >>> protected System.Web.UI.HtmlControls.HtmlGenericControl MapAreaName;
    >>>
    >>> However, it doesn't appear to be an HtmlGenericControl.
    >>>
    >>> I was going to try changing the href attribute with the
    >>> Attributes.Remove("href") then Attributes.Add("href", "new location")
    >>>
    >>> What would it be?
    >>>
    >>> Best regards,
    >>> Dave Colliver.
    >>> http://www.EdinburghFOCUS.com
    >>> ~~
    >>> http://www.FOCUSPortals.com - Local franchises available
    >>>
    >>>

    >>
    >>

    >
    >
     
    S. Justin Gengo, Oct 18, 2005
    #4
    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. Paul F. Johnson

    imagemaps and css

    Paul F. Johnson, Nov 14, 2003, in forum: HTML
    Replies:
    5
    Views:
    513
    Sid Ismail
    Nov 14, 2003
  2. brucie

    images vs imagemaps

    brucie, Jan 21, 2004, in forum: HTML
    Replies:
    11
    Views:
    636
    brucie
    Jan 22, 2004
  3. timothy
    Replies:
    4
    Views:
    1,398
    Jeffrey Silverman
    Nov 30, 2004
  4. Nathan Sokalski

    White strip showing up between two imagemaps

    Nathan Sokalski, Sep 22, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    377
    Nathan Sokalski
    Sep 23, 2006
  5. Yrrah
    Replies:
    5
    Views:
    340
Loading...

Share This Page