Friday, 16 December 2011

Ajax Slider Show Extender Control Image Click Event

Question:-Ajax Slider Show Extender Control  Image Click Event i want to do somthing ?


Answer:-

.aspx

<%-- Below image is  Slider Show Image --%>

 <a onclick ="popshow();" href ="#" >
    <asp:Image runat ="server" ID ="img1"   /></a>

<%-- Below Script get image url   --%>

<script language ="javascript" type ="text/javascript">
    function popshow() {
        var img = new Image();
        var x = document.getElementById('<%=img1.ClientID%>').src;
      alert(x);
 
//if u pass image url to code behind window  write var z  method
        var z = "<%=chkup(" + x + ")%>";
        alert(z);
//if u pass image  url  as query string
window.location.href='yourwebsitelocation?a='+x+';

            }
   
</script>

.aspx.cs

  public static string chkup(string url)
    {
      return "good";
    }



1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete