Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
4
Answers
How to get selected index og button using javascript? And ho
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
piya p
10y
1.6k
1
Reply
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?
}
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
I would like to know textbox restriction for the specipic nu
gridview with multiple records per row