0

Ello,

Firstly let me preface this with the fact that I'm absolutely hopeless at ASP.net. I know the basics, but that's it.

Right, I'm trying to fix a property site coded in ASP.net. On the property landing page, there is a small gallery of thumbnail images below a larger one (image is at bottom)

What's supposed to happen is that the large image changes on click. Except it doesn't. And I can't work out why it won't.

Even my php laced brain can see that the below code should work:

So this is from the Property details aspx page.

                                    <asp:DataList ID="dlPropertyPictures" runat="server"  RepeatColumns="4"
                                        DataSourceID="sdsPropertyPictures">
                                        <ItemTemplate>
                                            <br />

                                            <asp:ImageButton ID="imgSmall" runat="server" Height="50px" Width="50px" ImageUrl='<%# Eval("pic") %>' 
                                                onclick="imgSmall_Click"  />

                                        </ItemTemplate>
                                        <FooterTemplate>
                                        </FooterTemplate>
                                    </asp:DataList>

And the aspx.cs file has the following in:

    Protected Sub imgSmall_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) 
        imgLarge.ImageUrl = sender.ImageUrl
        End Sub

Yeah, so I don't get any error or anything. Nothing in the firebug console either. It's really weird.

I'm readying myself for abuse if I've missed something really simple, which I probably have.

Thanks,
Tom

bah

3
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by ZeroZen
0

the vb.net code only gets executed on server side, if you want to do anything dynamic, like changing the big picture, it will have to be done with javascript typically, althought there are versions of such galleries in pure css.

i might be wrong but from a quick look at your code that's the first thing that comes to my mind!

0

Hello Stereoworld

Have you tried enabling "AutoPostBack = True" on the images?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.