I have custom control called LinkControl :
<asp:Panel runat="server">
<script language="javascript" type="text/javascript">
function CheckImage() {
var str = document.getElementById('<%=lblBookmarkId.ClientID%>').firstChild.nodeValue;
PageMethods.CodebehindCheckImage(str);
return false;
}
</script>
<asp:Label runat="server" ID="lblBookmarkId" Style="visibility: hidden;" />
<asp:Button runat="server" ID="btnCheck" Text="Check" OnClientClick="return CheckImage();" CausesValidation="false""/>
</asp:Panel>
That control is used on Page Bookmarks inside repeater, each control put inside repeater has diffrent value of lblBookmarkId.Text.
Codebehind page Bookmarks has function :
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static bool CodebehindCheckImage(string str)
{
return true;
}
The problem is that when I press button btnCheck for any of the controls inside Repeater, when I debug in function CodebehindCheckImage I always get string lblBookmarkId.Text contained in last control that is present in Repeater.
Any suggestions would be welcome.
Regards Wojciech