Click here to Skip to main content
15,904,652 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi..

am using button control for updating records to database. At this time i want that when user click on button to save entry to database its cursor changes into 'wait' cursor for that perticular time. i used following code but its giving error: Sys is undefind object.
what should i do??
<script language="javascript">
   var prm = Sys.WebForms.PageRequestManager.getInstance();
 
  prm.add_initializeRequest(InitializeRequest);
  prm.add_endRequest(EndRequest);
 
  function InitializeRequest(sender, args) 
  {
    $get('Container').style.cursor = 'wait'; 
 
    // Get a reference to the element that raised the postback,
    //   and disables it.
    $get(args._postBackElement.id).disabled = true;
  }
 
  function EndRequest(sender, args) 
  {
    $get('Container').style.cursor = 'auto';
 
    // Get a reference to the element that raised the postback
    //   which is completing, and enable it.
    $get(sender._postBackSettings.sourceElement.id).disabled = false;
  }
                </script>


any help would be highly appriciated..
Posted

1 solution

i think you have used Ajax toolkit/script manager in your code. you need to add some tags in web.config.

Install ajax extesion and add following tag in web.config

Within the <httphandlers> </httphandlers> section, add the following entry

HTML
<add verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false" />


check the following link
http://geekswithblogs.net/ranganh/archive/2007/07/15/113963.aspx
 
Share this answer
 
Comments
Vikas_Shukla_89 11-Oct-11 5:09am    
Thanx Prashad for this usefull info
Vikas_Shukla_89 11-Oct-11 5:39am    
hey.. do u hav any idea about, why it showing var prm = null?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900