image control - no navigateurl ?

  • Thread starter Thread starter euan
  • Start date Start date
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?
 
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
 
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.
 
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
 

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

Back
Top