This is a migrated thread and some comments may be shown as answers.

RadButton AutoPostBack="False" not working

1 Answer 1333 Views
Button
This is a migrated thread and some comments may be shown as answers.
Clint
Top achievements
Rank 1
Clint asked on 08 Feb 2018, 12:04 AM

We are using version 2017.2.711.45 of Telerik.Web.UI and the behavior of RadButton's postbacks seems incorrect. My understanding has always been that when in Page_Load, code within if (!IsPostBack) should only run on initial load. Anything else would run as part of a postback. If you don't want a button to submit the form back to the server, you set it to AutoPostBack="False". Well, our buttons with that set are still posting back, and still getting into if (!IsPostBack)

Our buttons are using OnClientClicked with a function name. I tried adding (); return false; to the end of the function name, but that causes the button to instead act as a postback, and will go into an if(IsPostBack) so that's completely incorrect as well. Also it causes our radopen function to not open the RadWindow control.

Is this a problem with the version of Web.UI and do you know of one we can move up to that will fix this issue?

1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 12 Feb 2018, 09:29 AM
Hi Clint,

It is enough to set the AutoPostBack property of the button to False in order to prevent it doing a PostBack. Try to inspect the page and JavaScript code to check for potential errors and ensure that nothing executes a PostBack. Additionally, you can try to set the UseSubmitBehavior property to False and test again.

Attached you can find sample with a button that does not perform a PostBack when clicked while AutoPostBack is set to False.

Please try out the suggestions from above to see if that works for you and let us know about the outcome. If the issue still persist, I would advise you to open a formal support ticket, modify the sample from my response to produce the error and send it back to us where we will investigate it further.

I look forward to having your feedback. 

Kind Regards,
Attila Antal
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Button
Asked by
Clint
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Share this question
or