is there an equivilent to OnClientClick???

Last post 01-13-2012, 6:55 AM by Kenneth. 2 replies.
Sort Posts: Previous Next
  •  01-12-2012, 10:50 AM 72650

    is there an equivilent to OnClientClick???

    I have a page setup where I would like to hide an imagebutton when the user starts their upload. The only function that even allows me to manipulate the imagebutton is on fileuploaded. Which is useful for showing it again, but I cant hide it on uploading.
     
    I tried all the other options such as (AttachmentActionClicked,AttachmentAdded,AttachmentCreated,AttachmentDataBound) etc.. None of them will allow me to do this.
     
    I figured if you had an OnClientClick functionality, I could create by own postback in a javascript function to handle it.
     
    What are my options?
     
    I want to add I am using the autoupload option if this helps.
  •  01-12-2012, 10:41 PM 72664 in reply to 72650

    Re: is there an equivilent to OnClientClick???

    ??????
  •  01-13-2012, 6:55 AM 72674 in reply to 72650

    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 as RSS news feed in XML