HighTechTalks DotNet Forums  

imagebutton clicking issues

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss imagebutton clicking issues in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
vortigern79@yahoo.com
 
Posts: n/a

Default imagebutton clicking issues - 08-02-2007 , 04:33 PM






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:

<aspataList 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>
</aspataList>

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!


Reply With Quote
  #2  
Old   
PvdG42
 
Posts: n/a

Default Re: imagebutton clicking issues - 08-02-2007 , 07:46 PM






<vortigern79 (AT) yahoo (DOT) com> wrote

Quote:
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:

aspataList 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
/aspataList

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?




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.