www.webdeveloper.com
Results 1 to 2 of 2

Thread: JQuery/JavaScript help needed - How to point to ASP.NET's onClick event?

  1. #1
    Join Date
    Apr 2012
    Posts
    1

    JQuery/JavaScript help needed - How to point to ASP.NET's onClick event?

    Hi, on my ASPX page I have this JavaScript code:
    <script type="text/javascript" src="scripts/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="scripts/jquery.uploadify.js"></script>

    <script type = "text/javascript">
    $(window).load(
    function() {
    $("#<%=FileUpload1.ClientID %>").fileUpload({
    'uploader': 'scripts/uploader.swf',
    'cancelImg': 'images/cancel.png',
    'buttonText': 'Browse Files',
    'script': 'Upload.ashx',
    'folder': 'uploads',
    'fileDesc': 'All Files',
    'fileExt': '*.*',
    'multi': true,
    'auto': true
    });
    }
    );
    </script>
    It shows a button to select and upload multiple files to a SharePoint document library.

    Question: As of now it sends the action to "Upload.ashx"; How to send action to a method on the same page's code behind instead?

    Thanks a lot for your help, really appreciated, as I am stuck on this.

  2. #2
    Join Date
    Jun 2012
    Posts
    1

    create a public shared method

    Create a shared method in the code-behind and then reference it like so:

    "pagename.aspx/method name"

    don't forget to [WebMethod] attribute.

    Hope this helps

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles