image control - no navigateurl ?

Discussion in 'ASP .Net' started by euan@madprops.org, Nov 12, 2005.

  1. Guest

    Hey guys,

    I am just playing around with asp.net 2.0 and I was reading about the
    image control (for mobile designer) and thought that would be handy.

    So I have created:

    Do While intImgRatingCount < intImgRating
    intImgRatingCount += 1
    Dim myimg As New Image
    myimg.ImageUrl = "images/images.jpg"
    myimg.AlternateText = "Rating " & intImgRatingCount
    Form.Controls.Add(myimg)
    Loop

    And I would like to bind a link to each image. Apparently there should
    be a method of navigateurl?

    Should this be available? Does anyone know?
    , Nov 12, 2005
    #1
    1. Advertising

  2. Hi Euan,

    System.Web.UI.MobileControls.Image does have a NavigateUrl property.
    System.Web.UI.Webcontrols.Image does not have a NavigateUrl property.

    Double check you are using the correct class.

    Tim


    "" wrote:

    > Hey guys,
    >
    > I am just playing around with asp.net 2.0 and I was reading about the
    > image control (for mobile designer) and thought that would be handy.
    >
    > So I have created:
    >
    > Do While intImgRatingCount < intImgRating
    > intImgRatingCount += 1
    > Dim myimg As New Image
    > myimg.ImageUrl = "images/images.jpg"
    > myimg.AlternateText = "Rating " & intImgRatingCount
    > Form.Controls.Add(myimg)
    > Loop
    >
    > And I would like to bind a link to each image. Apparently there should
    > be a method of navigateurl?
    >
    > Should this be available? Does anyone know?
    >
    >
    =?Utf-8?B?dGlta2xpbmc=?=, Nov 12, 2005
    #2
    1. Advertising

  3. Guest

    Ah thanks Tim. Yeah was wondering if WebControls had a NavigateUrl
    property. Well... that sucks. I guess I can just create an image and
    put in inside a link.
    , Nov 13, 2005
    #3
  4. You can do :-
    <asp:HyperLinkColumn Target="_blank" DataNavigateUrlField="ID"
    DataNavigateUrlFormatString="test.aspx?ID={0}"
    Text="<img border='0' src='/urimage.gif'
    />"></asp:HyperLinkColumn>
    Do the binding as you want.
    Patrick


    <> wrote in message
    news:...
    > Ah thanks Tim. Yeah was wondering if WebControls had a NavigateUrl
    > property. Well... that sucks. I guess I can just create an image and
    > put in inside a link.
    >
    Patrick.O.Ige, Nov 13, 2005
    #4
  5. fabio.medeiros

    Joined:
    Sep 21, 2007
    Messages:
    1
    try this:

    Code:
    
        Dim myLink As New HyperLink
    
        With myLink
            .NavigateUrl = "http://www.asp.net"
            .Target = "_blank"
            .ImageUrl = ResolveUrl("~/Pictures/image.gif")
            .Text = "Asp.net web site"
        End With
    
    
    ok?
    fabio.medeiros, Sep 21, 2007
    #5
    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. Helixpoint

    NavigateUrl problem

    Helixpoint, Jul 22, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    369
    Helixpoint
    Jul 22, 2003
  2. Boban Dragojlovic
    Replies:
    3
    Views:
    3,032
    vMike
    Oct 29, 2003
  3. Replies:
    1
    Views:
    594
    =?Utf-8?B?RWx0b24gVw==?=
    Mar 8, 2006
  4. Arthur Dent

    HyperLink control; NavigateUrl; IE vs. Mozilla

    Arthur Dent, Sep 30, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    161
    clintonG
    Sep 30, 2005
  5. PerG
    Replies:
    0
    Views:
    565
Loading...

Share This Page