views:

108

answers:

2

Is it possible to update an UpdatePanel manually using JavaScript or jQuery?

What I have is a TextBox at the top of my page. When a user leaves that TextBox I want to run some server code (it will add a record to my database) then at the bottom of the page I have an UpdatePanel which will get refreshed. The UpdatePanel has a GridView which will have an entry for the record added)

+1  A: 

I think I got my answer... have to create a hidden button in the UpdatePanel then call __doPostBack('<%= Button.ClientID %>','');

rushonerok
+2  A: 

Just call this javascript function. Here UpdatePanel1 is updatepanel's ID

 <script type="text/javascript">

            var UpdatePanel1 = '<%=UpdatePanel1.ClientID%>';

            function ShowItems()
            {
               if (UpdatePanel1 != null) 
               {
                   __doPostBack(UpdatePanel1, '');
               }
            }       

        </script>
Azhar