Form Component CustomAutopostHandling Not Working

Lex Stewther asked on November 21, 2019 15:14

I am trying to create a custom form component for a Captcha control (we can't use Google's reCaptcha due to their constant switching of IP addresses). According to the documentation, setting the CustomAutopostHandling value to true should prevent the form from auto posting when the control is changed. However, this is not working for me. Everytime I type something into the field, the form repost, refreshing my captcha. Is there something else that needs to be set to prevent this from happening? Or is there a simpler way to implement a component without the full properties class, similar to how widgets can be created?

Recent Answers


Lex Stewther answered on November 21, 2019 19:48

Found a solution, though I'm not sure it's the correct one. I added the "data-ktc-notobserved-element" attribute to the HtmlAttributes for the control. This prevented the auto postback for the control.

1 votesVote for this answer Mark as a Correct answer

Mike Wills answered on November 21, 2019 21:18

Hi Lex,

You should be able to set the control's AutoPostBack property to false, to prevent an auto postback.

FormControl.AutoPostBack Property
Gets or sets whether a postback automatically occurs.

Mike

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.