المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Retaining focus after postback



C# Programming
08-27-2009, 04:23 PM
I'm tasked with helping a developer finish up a web page that collects information about an order and populates some SQL Server tables. ASPX with C#. I'm not a C# guy, but my main job here is to keep him on task, interface with the dept. that will need this, and validate the data design. At present, there are some issues with postbacks. He does a good bit of validation, mostly to ensure fields aren't blank, and posts back upon exit of a good many fields. One problem is retaining focus after postback. The user enters a value, presses tab, and a postback occurs. Instead of the focus moving to the next field, there seems to be no field with focus after the postback, which forces the user to click in the next field with the mouse. So instead of being able to tab to fields as expected, the user keeps having to use the mouse to get the focus to the appropriate field. This is not very desireable at all. Another issue is what fields cause a postback. An example would be a field that can be empty (zero), but if it's >0 another field needs to be populated. The postback occurs after the first field and an error message is displayed next to the second field saying it can't be empty, yet the user hasn't even had a chance to enter anything in that field. This is most likely a simple fix of where the validation originates from (the second field instead of the first), but the programmer seems to think this is hard to do or not doable. I may have to dig into C#, but some help here would be appreciated.

Thanks,

Russell