1. add a validator to a field such as textbox
2. set the "cause validation" property true for the textbox
3. set the "autopostback" property true for the textbox
4. while click on a button, check if Page.isValid
This is server-side examination to avoid 'javascript' being turned off maliciously in client-side browser.
If we want to validate manually, skip 2, 3,
then in 4, call page.Validate("VGroup"), before check Page.isValid.
"VGroup" is the name of the validation group the textbox belongs to.
set the "validation group" property as "VGroup" for textbox.
There are some kinds of validator available, such as 'RequireValidation' and 'RangeValidation'.
'RequireValidation' means the field is required and the validator will check if this field is filled up.
'Range Validation' is to check the input value of the field.
Saturday, January 29, 2011
Thursday, January 13, 2011
ASP.NET Ajax Calendar
Calendar is a handy feature in booking systems and is one of the comprehensive features integrated in ASP.NET 3.5.
First, you should download Ajax Control Toolkit
(remember to copy the AjaxControlToolkit.dll into the /bin folder of the web site application.)
Then, add the toolkit into the Visual Studio, see get started with the Ajax Control Toolkit (C#)
Last, implement calendar in your program, see Display a simple popup calendar
Calendar Samples shows several calendar types using Ajax Control Toolkit
First, you should download Ajax Control Toolkit
(remember to copy the AjaxControlToolkit.dll into the /bin folder of the web site application.)
Then, add the toolkit into the Visual Studio, see get started with the Ajax Control Toolkit (C#)
- On the Toolbox window, right click and select "Add Tab", the tab name as "AJAX Control Toolkit"
- Right click on the tab, select "Choose Items", then browse the directory where you put AjaxControlToolkit.dll, select it.
Last, implement calendar in your program, see Display a simple popup calendar
Calendar Samples shows several calendar types using Ajax Control Toolkit
- Add a ToolkitScriptManager
- Add a Textbox
- Add a CalendarExtender
Tuesday, January 11, 2011
SQL-Exercise
A good website for rookies to review and practice SQL: SQL Practice
Registration for free. There are more than 100 SQL exercises in 4 difficulty levels. It records the progress for users. That means, you can leave and log in to resume the unsolved questions. Pretty handy. Questions are well-designed and helpful to refresh SQL concepts.
Registration for free. There are more than 100 SQL exercises in 4 difficulty levels. It records the progress for users. That means, you can leave and log in to resume the unsolved questions. Pretty handy. Questions are well-designed and helpful to refresh SQL concepts.
Sunday, January 9, 2011
Section 508
'508 web accessibility compliance' was made to facilitate users with vision impairment to browse Federal web.
Youtube video:
Web Accessibility - through the "eyes" of a screen reader made me realized the importance of section 508 for people with disabilities.
1194.22 Web-based intranet and internet information and applications.
from Electronic and Information Technology Accessibility Standards (Section 508)
(a) A text equivalent for every non-text element shall be provided (e.g., via “alt”, “longdesc”, or in element content).
(b) Equivalent alternatives for any multimedia presentation shall be synchronized with the presentation.
(c) Web pages shall be designed so that all information conveyed with color is also available without color, for example from context or markup.
(d) Documents shall be organized so they are readable without requiring an associated style sheet.
(e) Redundant text links shall be provided for each active region of a server-side image map.
(f) Client-side image maps shall be provided instead of server-side image maps except where the regions cannot be defined with an available geometric shape.
(g) Row and column headers shall be identified for data tables.
(h) Markup shall be used to associate data cells and header cells for data tables that have two or more logical levels of row or column headers.
(i) Frames shall be titled with text that facilitates frame identification and navigation.
(j) Pages shall be designed to avoid causing the screen to flicker with a frequency greater than 2 Hz and lower than 55 Hz.
(k) A text-only page, with equivalent information or functionality, shall be provided to make a web site comply with the provisions of this part, when compliance cannot be accomplished in any other way. The content of the text-only page shall be updated whenever the primary page changes.
(l) When pages utilize scripting languages to display content, or to create interface elements, the information provided by the script shall be identified with functional text that can be read by assistive technology.
(m) When a web page requires that an applet, plug-in or other application be present on the client system to interpret page content, the page must provide a link to a plug-in or applet that complies with §1194.21(a) through (l).
(n) When electronic forms are designed to be completed on-line, the form shall allow people using assistive technology to access the information, field elements, and functionality required for completion and submission of the form, including all directions and cues.
(o) A method shall be provided that permits users to skip repetitive navigation links.
(p) When a timed response is required, the user shall be alerted and given sufficient time to indicate more time is required.
This tutorial page provides more details about the standard:
Web-based Intranet and Internet Information and Applications (1194.22)
This is a more elaborate tutorial
Web accessibility for section 508
Youtube video:
Web Accessibility - through the "eyes" of a screen reader made me realized the importance of section 508 for people with disabilities.
1194.22 Web-based intranet and internet information and applications.
from Electronic and Information Technology Accessibility Standards (Section 508)
(a) A text equivalent for every non-text element shall be provided (e.g., via “alt”, “longdesc”, or in element content).
(b) Equivalent alternatives for any multimedia presentation shall be synchronized with the presentation.
(c) Web pages shall be designed so that all information conveyed with color is also available without color, for example from context or markup.
(d) Documents shall be organized so they are readable without requiring an associated style sheet.
(e) Redundant text links shall be provided for each active region of a server-side image map.
(f) Client-side image maps shall be provided instead of server-side image maps except where the regions cannot be defined with an available geometric shape.
(g) Row and column headers shall be identified for data tables.
(h) Markup shall be used to associate data cells and header cells for data tables that have two or more logical levels of row or column headers.
(i) Frames shall be titled with text that facilitates frame identification and navigation.
(j) Pages shall be designed to avoid causing the screen to flicker with a frequency greater than 2 Hz and lower than 55 Hz.
(k) A text-only page, with equivalent information or functionality, shall be provided to make a web site comply with the provisions of this part, when compliance cannot be accomplished in any other way. The content of the text-only page shall be updated whenever the primary page changes.
(l) When pages utilize scripting languages to display content, or to create interface elements, the information provided by the script shall be identified with functional text that can be read by assistive technology.
(m) When a web page requires that an applet, plug-in or other application be present on the client system to interpret page content, the page must provide a link to a plug-in or applet that complies with §1194.21(a) through (l).
(n) When electronic forms are designed to be completed on-line, the form shall allow people using assistive technology to access the information, field elements, and functionality required for completion and submission of the form, including all directions and cues.
(o) A method shall be provided that permits users to skip repetitive navigation links.
(p) When a timed response is required, the user shall be alerted and given sufficient time to indicate more time is required.
This tutorial page provides more details about the standard:
Web-based Intranet and Internet Information and Applications (1194.22)
This is a more elaborate tutorial
Web accessibility for section 508
Friday, January 7, 2011
Rules of thumb on web design
I browsed some good articles about rules of web design for reference
(1) Rules of Thumb for Web Design
(2) 10 Web Design Rules That You Can Break
Although this article is trying to stimulate reader's thought, I would conservatively stick to these rules in my design:
(3) 5 Basic Rules of web page design and layout
Your web site should be......
(1) Rules of Thumb for Web Design
(2) 10 Web Design Rules That You Can Break
Although this article is trying to stimulate reader's thought, I would conservatively stick to these rules in my design:
- Do not display the horizontal bar
- Use a minimal number of font faces
- Do not use too many colors
- Make your site's goal obvious
- Navigation should be easy to figure out
- Use different colors for text and background
- Don't put animation in the way of your content
- Stick to web-safe fonts
- Don't have a splash/landing page
- Don't use tables
(3) 5 Basic Rules of web page design and layout
Your web site should be......
- easy to read
- easy to navigate
- easy to find
- web page layout and design be consistent through out the site
- quick to download
Thursday, January 6, 2011
50 Fresh Porfolio Websites for Your Inspiration -- Smash magazine
Recently while I started preparing for my personal website and portfolio, I bumped into this:
50 Fresh Porfolio Websites for Your Inspiration -- Smash magazine
I just browsed the first few websites and was surprised by the visualization and interactive effects they made. My first observation was that, they used a lot of javascript. Yet a question comes to my mind: how do they manipulate those technologies and combine them with design so elegantly that doesn't look abrupt?
Among these fantastic pieces of work, here are some of them that most arouse my attention:
This is a portfolio site of a company based on UK. It sounds sarcastic and self-content that they put "We made our mN online home using blood, sweat and a thing called Flash" on their website. Their work is definitely stimulating and fun however just a little bit arbitrary that I couldn't get how to use it at first.
This one arouse my interests is because of its color scheme: besides simple and neat, a naughty cat icon make me feel irresistible to the design.
50 Fresh Porfolio Websites for Your Inspiration -- Smash magazine
I just browsed the first few websites and was surprised by the visualization and interactive effects they made. My first observation was that, they used a lot of javascript. Yet a question comes to my mind: how do they manipulate those technologies and combine them with design so elegantly that doesn't look abrupt?
Among these fantastic pieces of work, here are some of them that most arouse my attention:
This is a portfolio site of a company based on UK. It sounds sarcastic and self-content that they put "We made our mN online home using blood, sweat and a thing called Flash" on their website. Their work is definitely stimulating and fun however just a little bit arbitrary that I couldn't get how to use it at first.
This one arouse my interests is because of its color scheme: besides simple and neat, a naughty cat icon make me feel irresistible to the design.
Subscribe to:
Posts (Atom)