diff --git a/README.md b/README.md index fef4beb..036cfe0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,146 @@ # jQuery-within-the-ASP.NET-UpdatePanel Working with jQuery within the ASP.NET UpdatePanel -There is also an article on this topic in CodeProject. -Click here: https://www.codeproject.com/Articles/601683/Working-with-jQuery-within-the-ASP-NET-UpdatePanel +## Getting Started + +While developing an ASP.NET Webforms application, I've found that I couldn't use JQuery alongside UpdatePanel ! I've looked deeply into it and found that the partial PostBack of UpdatePanel was removing the JQuery Events. Then I've made numerous attempts to make it working the UpdatePanel alongside JQuery ! I've googled a lot and reviewed a lot's of blog post but was unable to find the exact output from there !! + +Lastly I've found a solution to it by myself! + +To illustrate the procedure, I've made a demo project which has two fully functional pages. In Page1.aspx I've tried to add two numbers using JQuery and server side events. On the button '+' I've added two numbers from JQuery and on the button '+(*)' I've added two numbers from server side event. While the page1.aspx is loading, the JQuery event binding was occurred in document.Ready. + +The partial postback prevents the jquery to work. In this solution I've overcome the problem. I've solved it by the endRequest event which is raised after an asynchronous postback is finished and control has been returned to the browser. + +### Using the code + +In the project you will have two pages one is for jQuery not Working in Update Panel (Page1.aspx) and another is jQuery Working in Update Panel (Page2.aspx). + +In Page1.aspx jquery doesn't work. + +In the + button will add two numbers using jquery and +(*) button will add two numbers using client side method. Here is the Page1.aspx code : +``` +<%@ Page Language="C#" AutoEventWireup="true" + + CodeBehind="Page1.aspx.cs" Inherits="jQuerywithinUpdatePanel.Page1" %> + + + +
+Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: