tags:

views:

25

answers:

3

Can a post back to the user control be triggered from javascript (on the client side) without updatepanels?

What I am trying to achieve is this

  1. Initially the page and the user control are loaded with default values
  2. The parent pages makes a PageMethod request
  3. When the data is available (from the PageMethod request), the user control has to be reloaded to update with the new values
A: 

just call the preloaded function

you should find the following function in your rendered aspx page:

function __doPostBack(eventTarget, eventArgument) {
if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
    theForm.__EVENTTARGET.value = eventTarget;
    theForm.__EVENTARGUMENT.value = eventArgument;
    theForm.submit();
}
}

Or if you are trying to make an ajax call, you can use the jquery library instead of the update pannel:

http://encosia.com/2008/05/29/using-jquery-to-directly-call-aspnet-ajax-page-methods/

or a demo to make an ajax enabled control

http://dotnetslackers.com/articles/ajax/aspnetajaxcontroldevelopment.aspx

Glennular
Can I make a Jquery Ajax call from a user control? My understanding is that it needs to refer to a PageMethod
Narmatha Balasundaram