Showing posts with label focus. Show all posts
Showing posts with label focus. Show all posts

Saturday, March 24, 2012

Triggering partial update on text box losing focus

Hi,

I have a form on which I want a user to be able to enter a post code and, when the user tabs out of the field, triggers the population of a drop down list which contains the suburbs the postcode relates to, so the user can then select the suburb.

I have the drop down list in an Update Panel with partial rendering turned on but I can't figure out how to trigger it being refreshed when the control loses focus. I think I need to link it to the OnBlur event using javascript but I'm stuck at that point. Any ideas appreciated...

Thanks,

SimonOK, it was me being dippy. I didn't need to get clever and start hooking client side events, I just needed to set the Render property to "Always" and it fires whenever the text box loses focus.

S

Wednesday, March 21, 2012

trouble setting focus on a textbox after I put the panel in a updatepanel

My webpage was working fine setting focus properly on a textbox but after I put a few panels in an updatepanel the focus no longer works. I put two panels in the same updatepanel box, each one has a button click that goes and retrives some info. Everythng works fine except focus isnt being set. Im using c# in Visual Studio 2005 professional

how do you handle the focus of the textbox and in what event? usually you can set the focus using $get(textboxClientID) during the pageLoaded event of Sys.WebForms.PageRequestManager

hth


Are you using YourScriptManager.SetFocu(YourControl) ?


ScriptManager.SetFocus($get(textBox.ClietnId))

Let me know if this helpful to you