|
|
|
start date: Thu, 02 Aug 2007 20:33:18 -0000,
posted on: microsoft.public.dotnet.academic
back
| Thread Index |
|
1
unknown
|
|
2
PvdG42
|
imagebutton clicking issues
Hello,
I'm currently writing a webpage that lists photos dynamically.
Depending on what was selected in the page previous, these photos will
change. What I'd like to do it to have the user click on a photo and
for that to pull up another page associated with that photo. I can't
figure out how to make this happen, however. Here's my html referring
to the imagebutton:
<asp:DataList ID="DataList1" runat="server">
<AlternatingItemStyle BackColor="#FFFFCC"></AlternatingItemStyle>
<ItemStyle BackColor="White"></ItemStyle>
<ItemTemplate>
<table border="0" cellpadding="2" cellspacing="0" class="Normal">
<tr>
<td>
<asp:Imagebutton ID="imgPhotoGallery" ImageUrl='<%#
Container.DataItem %>' Runat="Server" />
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
And I can't seem to get this to attach to any function in the
corresponding .aspx file.
I initially thought it would be this function:
Protected Sub DataList1_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles DataList1.SelectedIndexChanged
Dim sRedirect As String
'go to edit page
sRedirect = "Photo_Edit.aspx"
Server.Transfer(sRedirect)
End Sub
But that doesn't seem to work.
Please help!
Date:Thu, 02 Aug 2007 20:33:18 -0000
Author:
|
Re: imagebutton clicking issues
wrote in message
news:1186086798.078210.257560@d30g2000prg.googlegroups.com...
> Hello,
>
> I'm currently writing a webpage that lists photos dynamically.
> Depending on what was selected in the page previous, these photos will
> change. What I'd like to do it to have the user click on a photo and
> for that to pull up another page associated with that photo. I can't
> figure out how to make this happen, however. Here's my html referring
> to the imagebutton:
>
> <asp:DataList ID="DataList1" runat="server">
> <AlternatingItemStyle BackColor="#FFFFCC"></AlternatingItemStyle>
> <ItemStyle BackColor="White"></ItemStyle>
> <ItemTemplate>
> <table border="0" cellpadding="2" cellspacing="0" class="Normal">
> <tr>
> <td>
> <asp:Imagebutton ID="imgPhotoGallery" ImageUrl='<%#
> Container.DataItem %>' Runat="Server" />
> </td>
> </tr>
> </table>
> </ItemTemplate>
> </asp:DataList>
>
> And I can't seem to get this to attach to any function in the
> corresponding .aspx file.
>
> I initially thought it would be this function:
>
> Protected Sub DataList1_SelectedIndexChanged(ByVal sender As Object,
> ByVal e As System.EventArgs) Handles DataList1.SelectedIndexChanged
> Dim sRedirect As String
>
> 'go to edit page
> sRedirect = "Photo_Edit.aspx"
> Server.Transfer(sRedirect)
> End Sub
>
> But that doesn't seem to work.
>
> Please help!
>
Can you provide a bit of clarification, please?
You first refer to the user clicking on a photo, then you show an event
procedure for a DataList_SelectedIndexChanged().
How are the photos in question being displayed (in what kind of control),
and how does the DataList instance relate to the photos?
Date:Thu, 2 Aug 2007 18:46:55 -0500
Author:
|
|
|