Re: is there an equivilent to OnClientClick???

  •  01-13-2012, 6:55 AM

    Re: is there an equivilent to OnClientClick???

    Hi websitepro,
     
    Please try the example below, it shows you how to catch the onclick event
     
    <%@ Page Language="C#" %>
    <%@ Register TagPrefix="CuteWebUI" Namespace="CuteWebUI" Assembly="CuteWebUI.AjaxUploader" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <script runat="server">
        protected void b2_Click(object sender, EventArgs e)
        {
            label1.Text = "b2 click";
        }
    </script>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <CuteWebUI:Uploader ID="Uploader1" runat="server" InsertButtonID="b1">
            </CuteWebUI:Uploader>
            <asp:Button ID="b1" runat="server" Text="upload" />
            <asp:Label ID="label1" runat="server"></asp:Label>
            <asp:Button ID="b2" runat="server" OnClick="b2_Click" Style="visibility: hidden" />
        </form>
    </body>
    </html>
    <script type="text/javascript">
    var uploader1=document.getElementById('<%=Uploader1.ClientID%>')
    var b2=document.getElementById("<%= b2.ClientID %>");
    uploader1.handlebrowse=function()
    {
        alert("click");
        //b2.click();
    }
    </script>
     
    Regards,
     
    Ken 
View Complete Thread