Saturday, March 24, 2012

Setting the control & calendar properties

Hi,

Is there any method in asp.net by which we can set the control for aparticular dropdownlist in a form (ie. like the setfocus, lostfocus,etc events in VB). Are there any components in asp.net like themonthyear component in VB? Any suggestions are welcome. Thanks.

you'll have to pass the .focus() to the clientside code as it's a clientbased event.

As for a Month/Year component... not builtin. You may find one in the control gallery here but it's simple enough to build with 2 ddl's.


rr83 wrote:

Are there any components in asp.net like the monthyear component in VB? Any suggestions are welcome. Thanks.

There are a rich variety of controls for ASP.NET published by third parties. You will find them listed on this site's Control Gallery,www.411asp.net andwww.123aspx.com. I am the author of some of them. MyPeter's Date Package includes a MonthYearTextBox with popup MonthYearPicker. Others have published controls that use DropDownLists. While its easy to create two dropdownlists, when designing a web page, always consider user interface issues. Here are a couple when comparing textboxes to dropdownlists:

- DropDownLists take up more space

- Textboxes allow typing, which can be much quicker than picking from a list for users who like to type. For users who don't like to type, a textbox is a disadvantage unless there is still a popup (like the MonthYearPicker I provide on mine.)

- Its easier to validate the textbox as "empty" because one RequiredFieldValidator handles it. Its harder to validate the actual entry in a textbox. The DropDownList always gives you valid values. I've solved this by offering a validator for my MonthYearTextBox. Any time you need a validator that isn't included with ASP.NET, you can use the CustomValidator to create your own rules.

0 comments:

Post a Comment