Hi,
try like below.
Add on click event for div tag.
<div class="image_stack" id="divAlbum" style="margin-removed300px ; removed 418px;">
onclick="return div_Click(this)" style="cursor:pointer;" runat="server">
<img class="stackphotos photo1" src="<%: a %>" />
<img class="stackphotos photo2" src="<%: b %>" />
<img class="stackphotos photo3" src="<%: c %>" />
</img></div>
Add attributes from code behind. i.e add album ID as attribute from code as below.
divAlbum.Attributes.Add("ID", 10);
The above line of code, must be written where your binding the images to the div tag.
write javascript function like below.
function div_Click(sender)
{
__doPostBack(sender.attributes["ID"].value, "div");
return true;
}
capture the argument in page load event as below.
protected void Page_Load(object sender, EventArgs e)
{
if (Request.Params.Get("__EVENTARGUMENT").ToString() == "div")
{
if (Request.Params.Get("__EVENTTARGET").ToString() != "")
{
int AlbumID = Convert.ToInt32(Request.Params.Get("__EVENTTARGET").ToString());
}
}
}
this will capture the event when user clicks anywhere within the div area
hope it helps