JQUERY Get ImageUrl from image control to image html inside user control
I have an image inside user control that display an image:
<%@ Control Language="C#" AutoEventWireup="true"
CodeFile="IVT_DisplayImage.ascx.cs"
Inherits="IVT_Sublayouts_IVT_DisplayImage" %>
<div class="page" >
<div class="box cf">
<div class="left">
<span class="demowrap">
<asp:Image ID="imgIdCard" class="imgClass" runat ="server"/>
</span>
</div>
</div>
</div>
And in my web form, I have a repeater with the previuos user control and
one button.
<asp:Repeater ID="ImageRepeater" runat="server"
onitemcommand="ImageRepeater_ItemCommand">
<ItemTemplate>
<div>
<uc1:IVT_DisplayImage ID="IVT_DisplayImage1" runat="server"
ImageURL="<%# Container.DataItem %>" />
<input id="mybutton" class="myClassButton" type="button"
value="Full Size" onclick="resize()" />
</div>
</ItemTemplate>
</asp:Repeater>
I want, that when I call the the function onclick="resize()", pass the
value of ImageUrl from image inside of user control and assigned to img
id="imageDialog":
<div id="dialogImage">
<img id="imageDialog"/>
</div>
I tried doing this task, but it's not working:
function resize() {
$("#imageDialog").attr('src', img.attr('src'));
$("#imageDialog").attr(imgUrl, img.attr(imgUrl));
$('#dialogImage').dialog("open");
}
Any idea? Why I can't get the parameter from ImageUrl from user control to
the img id="imageDialog"??? Note: If I have several images, the buttom
must be releated with the specific images in the repeater.
No comments:
Post a Comment