Click here to Skip to main content
15,885,908 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all

i have a datalist containing one html hyperlink button when client clicks on that hyperlink, i want to show popup window using jquery but when i test my code nothing happens. when i put same hyperlink outside the datalist it works perfectly .
what is going wrong in datalist
JavaScript
<script type="text/javascript">
function changeLabel()
{
$("#popupCon").css({
			"opacity": "0.7"
			
		});
}
$(document).ready(function() {
       document.getElementById('popupCon').style.display = 'none';
 $("#Button33").click(function(){
document.getElementById('popupCon').style.display = 'block';
        changeLabel()
});
$(document).keypress(function(e){
		if(e.keyCode==27){
			document.getElementById('popupCon').style.display = 'none';
}
});
        });
</script>


ASP.NET
<a id="Button33"  runat="server">view details</a>

need some help
Posted
Comments
tanweer 31-May-12 2:58am    
check your Button ID generated by HTML source. Is it same as it is out side the datalist?? if it is changed inside datalist then use this ID in your Jquery code.....

1 solution

Hi there,

This is probably an issue because ASP.Net will change your control's ID unless you use the ClientID property/attribute. Please take a look at the following page:
http://msdn.microsoft.com/en-us/library/system.web.ui.control.clientid.aspx[^]

Hope this helps,
Ed
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900