asp网站毕业设计英文文献_第1页
asp网站毕业设计英文文献_第2页
asp网站毕业设计英文文献_第3页
asp网站毕业设计英文文献_第4页
asp网站毕业设计英文文献_第5页
已阅读5页,还剩9页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、making an asp.net web site accessiblescott mitchellmay 2004summary: take advantage of inheritance in the .net framework to extend asp.net classes to make them generate asp.net code that is fully accessible to people with disabilities. (13 printed pages)introductionwhile the majority of online users

2、are able to browse web sites using web browsers with the typical browser settings, users with disabilities commonly use alternative means to access online information. for example, a blind user might use a text-only browser that converts the text into braille, or reads the text aloud using a screen

3、reader. a person with reduced vision might still use a browser like microsoft® internet explorer, but with a screen magnifier, or with the browser configured to use extra large font sizes. motor disabilities might preclude a user from using the mouse or keyboard as an input device.since people w

4、ith disabilities typically surf the web using special devices or non-standard browser configurations, a web sites overall design and html markup greatly impacts the disabled persons user experience. for example, specifying font sizes using absolute measurementslike 10ptdisplays the font in that abso

5、lute size, and not relative to the text size the user has configured in his browser. sites that have a flash or shockwave interface, and do not provide an alternate, text representation, effectively cut off users with braille devices or text-to-speech synthesizers. a web site is said to be accessibl

6、e if it is designed to transition gracefully to alternate devices.at this point, you might be thinking, why should i bother ensuring my web site is accessible? there are two good reasons i can think of: 1.its good business according to the u.s. census 2000, 49.7 million americans have a disability;

7、a june 2000 poll by harris interactive shows that 43% of disabled americans are regular online users, and that users with disabilities spend almost twice as much time online than users without disabilities. put the results of these two surveys together and youll find that there are more than 21 mill

8、ion americans with disabilities who are regularly online. by not taking the time to make your web site accessible, you are cutting off 21 million potential visitors. 2.its a mandate for government agencies in 1998 the united state government passed section 508 of the rehabilitation act, requiring fe

9、deral agencies to make their electronic information accessible to individuals with disabilities. this law provides accessibility guidelines for software applications and web applications, as well as telecommunication products and video products. not only are federal agencies required to implement ac

10、cessibility guidelines, but also private companies that are contracted to work for the federal government. (a number of countries outside the u.s. also have similar accessibility requirements for government agencies.) therefore, creating accessible web applications is required if you work for the go

11、vernment or for a company that provides services to the government. in this article we will discuss what steps you can take to ensure that your microsoft asp.net web site is accessible. well take a brief look at the official accessibility guidelines available today, and then focus in on the accessib

12、ility guidelines used by the united states government. the article wraps up with a look at how to use inheritance to turn non-accessible asp.net web controls into ones that meet accessibility guidelines.the wai, wcag, and section 508there are a number of steps that can be taken to make a web site mo

13、re accessible. but what, exactly, are these steps, and how many of them does one site need to employ in order to be considered accessible? the answers to these questions differ based on who you ask, and what level of accessibility they need to provide. an intranet site for a fortune 500 company woul

14、d likely require a higher degree of accessibility than an intranet site for a company with only 25 employees.the wc3s say on accessibilityto help formalize this discussion, in 1999 the wc3 officially founded the web accessibility initiative (wai), a group tasked with improving web site usability for

15、 people with disabilities. the wais first act was to publish the web content accessibility guidelines, or wcag. the wcag provides a list of 14 guidelines for accessible web site design. the guidelines themselves do not spell out actions to take to make a web site more accessible. rather, they are hi

16、gh-level statements that provide comment on how to ensure accessibility. for example, guideline 1 is provide equivalent alternatives to auditory and visual content. accompanying each guideline is a set of checkpoints. the checkpoints spell out actions that can be taken to ensure that the accessibili

17、ty guideline is met. each checkpoint is given one of the following priority values: priority 1 a web developer must satisfy this checkpoint, otherwise one or more groups of users will not be able to access the content. priority 2 a web developer should satisfy this checkpoint, otherwise one or more

18、groups of users will find it difficult to access the content. priority 3 a web developer may address this checkpoint, otherwise one or more groups of users might have difficulty when accessing the content. in addition to listing the 14 guidelines and their associated, prioritized checkpoints, the wc

19、ag also provides a three-level classification scale for web site accessibility. sites that implement all priority 1 checkpoints are rated at conformance level a. those that implement all priority 1 and priority 2 checkpoints are rated double-a, while those that implement all of the checkpoints are r

20、ated triple-a. the wcag gives a good set of actions to perform to ensure varying levels of accessibility.although a thorough discussion of the wcag is beyond the scope of this article, listed below are the 14 high-level guidelines of the wcag. the checkpoints for each guideline, and their associated

21、 priority, can be found at the official web content accessibility guidelines 1.0 specification. 15.provide equivalent alternatives to auditory and visual content 16.dont rely on color alone 17.use markup and style sheets and do so properly 18.clarify natural language use 19.create tables that transf

22、orm gracefully 20. ensure that pages featuring new technologies transform gracefully 21. ensure user control of time-sensitive content changes 22. ensure direct accessibility of embedded user interfaces 23. design for device-independence 24. use interim solutions 25. use w3c technologies and guideli

23、nes 26.provide context and orientation information 27.provide clear navigation mechanisms 28. ensure that documents are clear and simple microsofts accessible asp.net web controls for asp.net 1.x.many of the wcag checkpoints and section 508 rules dictate specific html markup that should be used to m

24、ake a web site more accessible. for example, checkpoint 5.1 in the wcag (a priority 1 checkpoint) and rule (g) in section 508 requires that elements properly identify row and column headers. that is, the element must be used to identify data cells, whereas must be used to identify headers.when build

25、ing asp.net web sites, developers rarely have to worry about generating html markup. rather, web controls are used that emit the proper markup. unfortunately, many of the asp.net web controls emit markup that violates the accessibility rules outlined by the wcag and section 508. since all web contro

26、ls are, fundamentally, classes in the microsoft® .net framework, their functionality can be extended in a number of ways to conform to accessibility guidelines.a prime example of enhancing an existing asp.net web control to meet accessibility guidelines can be seen with the datagrid web control.

27、 the datagrid web control that ships with the .net framework does not conform to rule (g) in section 508 / checkpoint 5.1 in the wcag. that is, the headers are rendered using elements instead of . (to see what i mean, check out this live demo, and do a view/source in your browser. youll see that the

28、 header row uses s rather than s.) however, in june 2003 microsoft released an asp.net hotfix rollup package that, among other things, includes an improved version of the datagrid, one that conforms to rule (g) in section 508.notethe asp.net hotfix rollup package provides other accessibility-related

29、 enhancements. for example, it adds an optional associatedcontrolid property to the label web control to specify the id of the web control the label is associated with. if this property is provided, the label is rendered as a html element with the for attribute referencing the specified web control.

30、 for more information consult this knowledge base article.creating an adaptive, accessible datagrid web controlthe web controls provided in the june 2003 hotfix bring the asp.net web controls up to section 508 standards. even with the hotfix, however, there are still a number of wcag priority 1 chec

31、kpoints not being met. fortunately you can easily extend the functionality of existing web controls to conform to the accessibility guidelines required by your company. this is possible thanks to the power of inheritance. specifically, we can take a web control that does not conform to the accessibi

32、lity standards, and create an extended web control that does conform to the standards. by using inheritance, we only have to change or add the functionality to make the control conforming to the standards, and do not have to rewrite the base functionality.wcag checkpoint 6.3 reads: ensure that pages

33、 are usable when scripts, applets, or other programmatic objects are turned off or not supported. if this is not possible, provide equivalent information on an alternative accessible page. for example, ensure that links that trigger scripts work when scripts are turned off or not supported (for exam

34、ple, do not use javascript: as the link target). however, the linkbutton web control is rendered as a hyperlink with a javascript: link target (.). the problem is that browsers that dont support javascript wont be able to postback the web page by clicking on the linkbutton. this renders sortable dat

35、agrids unsortable in browsers that dont support javascript since the column headers are rendered as linkbuttons.the remainder of this article looks at building a set of adaptive custom datagrid columns that will display a button web control in the header of a sortable datagrid if it is visited by a

36、browser that doesnt support javascript. the button web control works for browsers that do not support javascript since it renders a tag rather than a hyperlink with a javascript: link target.note section 508 does not require that links not use the javascript: link target. section 508s sole comment o

37、n client-side script can be found in rule (l), which reads: 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. what this rule requires is that

38、 if content is generated by script, or if a pages behavior is modified via script, that a html element be used with an explanation of the script behavior. regardless, i have heard from several developers working on government projects that required them to support browsers without javascript functio

39、nality.making datagridcolumn adaptivethe datagrid web control is comprised of a number of columns, which are classes that derive from the system.web.ui.webcontrols.datagridcolumn class. asp.net ships with five built-in datagrid column types: 1. boundcolumn 2. buttoncolumn 3. editcommandcolumn 4. hyp

40、erlinkcolumn 5. templatecolumn the base class, datagridcolumn, provides the properties and methods inherent to all datagrid column types. these include properties like headertext, sortexpression, visible, and others. the datagridcolumn class has two methods that play an important role in creating a

41、datagrid: initialize() initializes the datagridcolumn. called once per column during the datagrids databinding process. initializecell(cell, index, itemtype) called for each cell that is created during for each column during the datagrids databinding process. cell is a tablecell object representing

42、the actual html cell for the cell being initializes; index is the row index of the cell being initialized; itemtype is value from the listitemtype enumeration, specifying what type of cell is being added (item, alternatingitem, header, footer, edititem, and so on. the datagridcolumn class is respons

43、ible for rendering the header and footer for the column. the derived classes boundcolumn, buttoncolumn, editcommandcolumn, etc. are responsible for rendering the datagrid items.note for more information on creating custom datagrid columns, check out marcie robillards article creating custom columns

44、for the asp.net datagrid.to have our datagrid adaptively render the header based on whether or not the users browser supports javascript, we need to create a custom datagrid class that is derived from datagridcolumn. this custom datagrid column class, named accessibledatagridcolumn, will need to ove

45、rride the datagridcolumn classs initializecell() method, checking to see if the datagrid is configured for sorting and being visited by a browser that doesnt support javascript. if these two conditions are true, then accessibledatagridcolumn will render a button in the header as opposed to a linkbut

46、ton. the code for this class is shown below:public class accessibledatagridcolumn inherits datagridcolumn public overrides sub initializecell( _ byval cell as tablecell, _ byval columnindex as integer, _ byval itemtype as listitemtype) dim sorting as boolean = _ not me.owner is nothing _ andalso me.

47、owner.allowsorting _ andalso me.sortexpression.length 0 dim supportsjs as boolean = _ not httpcontext.current is nothing _ andalso httpcontext.current.request.browser.javascript if sorting and not supportsjs _ and itemtype = listitemtype.header and not me.designmode _ then if me.headerimageurl.lengt

48、h 0 then dim b as new imagebutton b.alternatetext = me.headertext b.imageurl = me.headerimageurl b.commandname = sort b.commandargument = me.sortexpression b.causesvalidation = false cell.controls.add(b) else dim b as new button b.text = me.headertext b.commandname = sort b.commandargument = me.sort

49、expression b.causesvalidation = false cell.controls.add(b) end if else mybase.initializecell(cell, columnindex, itemtype) end if end sub end class the overridden initializecell() method checks to see if sorting is enabled, if the current browser does not support client-side javascript, if the curren

50、t item being initialized is a header, and if the rendering is not being performed in microsoft® visual studio® .nets designer. if this check passes, then another check is performed to determine if the column has a headerimageurl value specified. if it does, it renders an imagebutton, setting

51、 its alternatetext to the columns headertext. if there is no headerimageurl specified, a button is created and added to the cell. note notice that the check to see whether or not a browser supports javascript simply looks up request.browser.javascript property. this property is set based on the user

52、-agent string sent by the browser to the web server. the adaptive datagrid will render buttons in the header for a sortable datagrid when someone visits with a browser that is known not to support javascript, such as netscape 1.0, or lynx. if someone visits with microsoft® internet explorer 6.0

53、it will render the default linkbuttons, even if the visitor has manually turned off javascript support.using the accessible datagrid column classes in an asp.net web pagethis articles download includes two microsoft® visual studio® .net 2003 projects (both visual basic .net projects): the fi

54、rst is a class library that contains the custom datagrid column classes; the second is an asp.net web application that you can use to test out the adaptive, accessible datagrid column classes.to use these custom datagrid column classes in an asp.net web project you need to first add the compiled ass

55、embly of the custom datagrid column classes to the asp.net web projects /bin folder. (if you are using visual studio .net, the simplest way to do this is to add the assembly to the references folder in the solution explorer.) next, you need to add a references directive at the top of the asp.net web

56、 pages that will utilize these datagrid columns like so: finally, to use the columns, add a datagrid to the asp.net web page and set the autogeneratecolumns property to false. in the html portion, add the following syntax: . thats all there is to it! figure 3 shows a screenshot of the html portion of an asp.net web page

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论