Quantcast
Channel: AjaxControlToolkit Work Item Rss Feed
Viewing all articles
Browse latest Browse all 4356

Closed Issue: TextBoxWatermarkExtender removes focus when using code behind .focus() [14778]

$
0
0
The TextBoxWatermarkExtender removes focus from a textbox when focus was set using code behind .focus()

I looked at the src for TextBoxWatermarkExtender (thank you for providing source!!!) and it's checking for 'Page.Form.DefaultFocus' - it would appear than 'control.focus()' doesn't set Page.Form.DefaultFocus, so the TextBoxWatermarkExtender is not recognising the .focus() call.

Example attached, reproduction:

New web form
Add two textboxes (to focus on second)
Add TextBoxWatermarkExtender to second
In Page_Load, add: secondTextBox.Focus()

Result: Focus is not preserved.

Clunky work-around: Instead of secondTextBox.Focus(), have to use: Me.Form.DefaultFocus = secondTextBox.ClientID


This might be considered a bug with .Focus(), but the AJAX Control Toolkit would probably get updated sooner....
Comments: This ticket was filed for a pre-15.1 version of AJAX Control Toolkit. If this is still an issue in v15.1 or later, please create a new inquiry.

Viewing all articles
Browse latest Browse all 4356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>