TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
piya p
NA
84
48.4k
How to get selected index og button using javascript? And ho
Apr 24 2014 2:16 AM
In my application I am using Image buttons in datalist.
When user will click on any image button index of that button should come.
and according to that index user will display inner data of image.
This is my code:
<asp:DataList ID="datalist" RepeatDirection="Horizontal" RepeatColumns="4" AlternateText=" " runat="server" Height="102px" Width="229px" CellSpacing="5" >
<ItemTemplate >
<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl='<%# Eval("img1") %>' Height="150" Width="150" AlternateText=" " OnClick="ImageButton1_Click" CommandName="imgClick" />
<br />
</ItemTemplate>
</asp:DataList>
And code for button click is:
ImageButton imgbtn = (ImageButton)sender;
DataListItem item = (DataListItem)imgbtn.NamingContainer;
int index = item.ItemIndex;
MyDetails details = (MyDetails)listItems[index];
int id = details.getAlbumid();
Response.Redirect("Page2.aspx?id1=" + Convert.ToString(id));
Above code working properly when redirecting.
But I need When user click on any image the page 2 should come as popup page. with selected index n all.
How to make next page as popup?
}
Reply
Answers (
4
)
how to display only column name from database in asp.net mvc
gridview