image control - no navigateurl ?

E

euan

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?
 
G

Guest

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
 
E

euan

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.
 
P

Patrick.O.Ige

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
 
Joined
Sep 21, 2007
Messages
1
Reaction score
0
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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,563
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top