javascript - WebForm_AutoFocus is not being generated -
i have asp.net page not generate expected "webform_autofocus()" javascript, though explicitly calling .focus() on 1 of controls. there known scenarios factor prevent javascript being generated?
specifically, when user clicks particular button, i'm creating new controls dynamically: in case text box. in onprerender i'm grabbing newly-created control , calling .focus() on it. idea is, when postback completes, browser gives focus newly-created textbox control. however, generated html (verified via firebug , fiddler) not contain webform_autofocus call @ all.
in other scernarios, same page (on postback or on initial hit) calls .focus() on different control - 1 not dynamically created; in cases webform_autofocus() script generated perfectly, , well.
unfortunately, i'm working on client system loves frameworks upon frameworks, , abstractions upon abstractions, cannot post meaningful/concise code sample here. however, if of friendly so'ers knows more generation of "webform_autofocus" javascript - , scenarios prevent being generated - give me place start digging.
the autofocus call gets included if asp.net thinks there need it. set default button on page asp.net know make method.
Comments
Post a Comment