locked
How Can I Prevent A Page Refresh On Button Clicks While Using AJAX ToolKitScriptManager? RRS feed

  • Question

  • User1217276006 posted

    Hey ASP.net,

    Does anyone know how to solve this problem? Basically, I am using the AJAX ToolKit in my web app. The problem I'm having is that whenever any of the standard button controls are clicked, the entire webpage refreshes. This browser refresh is time-consuming, unnerving (for the user), and subpar. I narrowed the problem down to just the ToolKitScriptManager. If I remove the ToolKitScriptManager then the page behaves normally - and beautifully. 

    Here are the details:

    • Visual Studio 2012
    • Language: Visual Basic
    • AJAX Tool Kit

    Things I've Tried: <asp:button OnClientClick="return false">. This prevents the page refresh, but it prevents the button's action as well. So, I can't use it. 

    Can anyone help?

    Tuesday, September 24, 2013 2:49 PM

Answers

  • User-1360095595 posted

    You can fake it by using an updatepanel. Otherwise, you'll need to get into using AJAX and client-side scripting/manipulation.

    [Edit:  correct spelling.]

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 24, 2013 2:51 PM

All replies

  • User-1360095595 posted

    You can fake it by using an updatepanel. Otherwise, you'll need to get into using AJAX and client-side scripting/manipulation.

    [Edit:  correct spelling.]

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, September 24, 2013 2:51 PM
  • User1217276006 posted

    Okay...

    ...Thanks. This UpdatePanel control is working out pretty well. I can achieve the desired results by using dozens (and dozens) of UpdatePanels to prevent the entire page from refreshing. This should work for now. Hopefully, in the future, I'll learn more about this AJAX stuff to that I can prevent the page/reload action without using a blocker.

    Also, I found a good intro to Control Panel's on Microsoft's website. Here it is:

    http://msdn.microsoft.com/en-us/library/bb399001.aspx

    Tuesday, September 24, 2013 3:33 PM