版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、外文资ASP3.0&IIS5.0newCharacteristicOne of the most exciting new features in ASP 3.0 and IIS 5.0 is roduction programmable serverside redirection.What this means t, finally, we can transfer control executionofa page tovingtobother外文资ASP3.0&IIS5.0newCharacteristicOne of the most exciting new features in
2、 ASP 3.0 and IIS 5.0 is roduction programmable serverside redirection.What this means t, finally, we can transfer control executionofa page tovingtobotherthentbyusing WellseewhatwemeanbythisTheProblemswithnt-sideASPprogrammers regularly use the Response.Redirect ement to load a different page the t
3、is currently executing. However, many dont t this doesnt cause the server to y load and execute the ge. What it actually does is add HTTPredirectionheadertotheoutputstreambeingsentfromtheWebservertotheThisheaderlookssomethinglikeHTTP/1.1302ObjectLocationThe standard HTTP us his header, 302 Object ls
4、 the tresource they requested has moved. The Location rovides the address of the they want. coursethis ve tobe thereality what ng isfooling the o t page they want can be found at a different location. What is happening t our server executing the page they requested, but ling t page they s moved. Thi
5、s is why we have to execute the Redirect method before we anypagecontenttotheWhenabrowserreceivesthe302ObjectMovedmessageitrespondsbycancelingtherequest and sending a new request for the page he Location value. This works in the same way as when we use a METAHTTP-EQUIV he section of the page theHTTP
6、headershownrisequivalent So the redirection is actually happening on the nt, not on our server. While this generally a problem, it can cause spurious messages to be displayed if there is a proxy server use at the nt end of the connection. The proxy server will ercept the us and may itself generate a
7、 t is sent on to the t made the original request. This whytheubiquitousandannoyingThe object you requested has been moved and can be found here is often displayed on ntwhenand may itself generate a t is sent on to the t made the original request. This whytheubiquitousandannoyingThe object you reques
8、ted has been moved and can be found here is often displayed on ntwhenweuseResponse.Redirect,althoughproperuseofbufferingcanusuallypreventWhen you use Response.Redirect S 4 or r, you should always turn on buffering the top of your ASP page and then call Response.Clear before executing the method. Of
9、course, with page buffering being turned on by default in ASP3.0, this is not such ie. As long as you use Response.Clear before executing the ement,no previously outputwillbesenttotheServer-sideRedirectioninASPInASP3.0andIIS 5.0,we canavoidtheneedtouse nt-sideredirectioninalmostallby taking advantag
10、e of the two new Server object methods: Execute and Transfer. They control to be passed y to age, which can be an ASP script page or any resourcesuchasanHTMLpage,zipfile,orothertypeofThe difference n them t the Execute method calls the age, much like call a subroutine or function in our script code.
11、 When the age or resource has execution or streaming to the nt, control passes back to the ement following the call to Execute he original page, and execution continues from there. When we use Transfermethod, controldoesnotpass backto theoriginal page,andexecution stopsthepageorresourcewetransferred
12、controlWhat makes the two methods even more useful t the current pages context passed to page or resource. This includes the values of all the variables in all rinsicASPobjects,suchasthecollectionsoftheRequest,Responseandobjects,andtheirproperties.TheApplicationcontextisalsotransferred,evenifthepage
13、iswithinadifferentvirtualThe result of all this t the browser t its still receivingthe original page. sno tanything unusual is going on at our server. Its Addressbar still shows the same and (best of all) the Back, Forward and Refresh buttons work normally. When we use nt-redirection,llynHTMLMETAele
14、ment,thisisntusuallythePart of the t is transferred to the ge or resource is any existing e. While we arent going to look at ions in detail until a later chapter, its mentioning here. The current pages context is encapsulated with the ASP ObjectContext which we discussed in Chapter 1. If we need to
15、work with this e. While we arent going to look at ions in detail until a later chapter, its mentioning here. The current pages context is encapsulated with the ASP ObjectContext which we discussed in Chapter 1. If we need to work with this object as part of an ion,wecanuseithe twe transfercontrolWha
16、tareScriptingAn object is basically a way of understanding how the various parts of the systemThe ASP object provides a t we can use to manipulate the he HTTPrequests and responses, and the ASPenvironment as a whole. For we saw how we can find out the values of s sent from the browser by scollection
17、,whichispartof theASPRequestThe scripting languages we use also have an object . However, this is for t the scripting languages provide, as ed to the objects like Request and t are provided directly by the ASP DLL. The scripting objects are provided by Scripting Runtime Library (scrrun.dll), which i
18、s installed with the default Active Scripting providesthreemainobjectsaspartoftheScriptingRuntimeThe Dictionary object provides a useful storage t we can use to store sedandreferencedbytheirnamenbyindex,aswouldbe thecaseina normalFor le, its ideal for storing the name/value t we retrieve from the AS
19、P The FileSystemObject object provides us cs to the underlying file system on server (or on the nt in IE5 when used in conjunction with a l type of page named Hypertext Application or HTA). We can use the FileSystemObject object to iterate through machineslocalandnetworkeddrives,foldersandTheTextStr
20、eamobjectprovidesstofilesstoredondisk,andisusedinconjunctionthe FileSystemObject object. It can read from or write to text (sequential) files. It can only instantiated via the FileSystemObject object, so you might prefer to think of it as a child The ASP Server object is designed to provide the feat
21、ures we need to create these components and applications, t we can use them to extend the capabilities of our scripts. It does this by implementing a l ofthe CreateObject method. Well see thisisrequiredCreatingObjectinVBScriptandInVisualBasic orVisualthese components and applications, t we can use t
22、hem to extend the capabilities of our scripts. It does this by implementing a l ofthe CreateObject method. Well see thisisrequiredCreatingObjectinVBScriptandInVisualBasic orVisualBasicforApplications(VBA),wecancreate of objects avarietyofways.WecanusetheNewkeywordtocreateanewobjectofthetypeDimHoweve
23、r,thissibleinASPwithVBScriptor JScript,because these scriptingdont implement y. We cant declare a variable as being of any specific ype areallVariantsoranequivalenttype(dependingonthescriptinglanguageinternative in Visual Basic and VBAis the use of eric methods. The CreateObject method takes as its
24、argument a or (more usually) a string,andreturnsa newobjecttSetobjNewObject=TheGetObject methodis normallyusedwhenwe haveofa specifictype,andwanttocreate aninstance ofantcanhandlethistype :SetobjExcel=Weso specify the type of t we want as well as a filename, which is useful wehaveseveraltcan tSetobj
25、Excel=GetObject(C:myfilessales.xlw,VBScript supports CreateObject and GetObject. s getObject, which works like VBScript. JScript also implements a t he same way as the CreateObjectmethod, namedActiveXObject.However this isused inconjunction withthe new objNewObject=newWith the exception of the Visual Basic New keyword, which isnt supported in VBScript JScript, we can use all these techniques to create of objects within an ASP However, can doesnt
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 马术开业活动策划方案(3篇)
- 景区游乐设施定期检查制度
- 档案管理制度
- 2026江西赣州市章贡区社区工作者(专职网格员)招聘102人备考题库完整答案详解
- 2026广东佛山南海大沥镇海北第四幼儿园招聘备考题库含答案详解
- 2025福建福州市鼓楼区鼓东街道招聘专职网格员1人备考题库(12月)含答案详解
- 2026四川成都传媒集团集团管理媒体单位副职招聘1人备考题库及完整答案详解
- 酒店装修款财务制度
- 关于酒店前厅部财务制度
- 知乎夫妻财务制度
- 2026年锂电池项目投资计划书
- (二诊)绵阳市2023级高三第二次诊断考试历史试卷A卷(含答案)
- 2026年电力交易员岗位能力认证考核题含答案
- 2026年及未来5年市场数据中国金刚石工具行业投资分析及发展战略咨询报告
- 2025-2026学年总务主任年度述职报告
- 机电井(水源井)工程施工技术方案
- 2025ACCP实践指南:危重患者血浆与血小板输注指南解读
- 【语文】辽宁省沈阳市沈河区文化路小学小学一年级下册期末试卷(含答案)
- 脚手架施工环境保护措施方案
- 符号互动理论课件
- 兽药使用法律法规学习材料
评论
0/150
提交评论