ASP网页设计在ASP中利用Ad Rotator告白组件
缺乏可以共同遵循的行业标准,ASP还处在发展初期,大家对它的理解不同,如产品和服务标准,收费标准等,不利于行业的健康发展。告白TherearethreepartstoconsiderwhenusingtheAdRotatorcomponent.TheRotatorScheduleFile
TheinstantiationoftheAdRotatorobjectitselfwithinthewebpagewhereyouwantyourbannersrotated
TheRedirectionFile
First-TheRotatorScheduleFile
Thisisthemeatofthedifferentbannersandwheretheyaresentwhenthegraphicfilesareclicked.
Therearetwosections-
Thefirstsectionliststheparametersthatapplytoalladvertisementimagesintherotationschedule,
linebyline.
ThefirstlineisthenameoftheRedirectionFile.
Thesecondlineisthewidthofthegraphic
Thethirdlineistheheightofthegraphics
ThefourthLineistheborderaroundthegraphics-foraonepixelborder,youwouldput1,forno
border,putin0
Example:
redirectRedirect.asp
Width468
Height60
Border0
Thesecondsectionmustbeseparatedfromthefirstsection,onaseparateline,byanasterisk(*).This
sectioncontainsallthedataforeachofthegraphics.Foreachbanner/adgraphics,therearefourlines.
FirstLine-theurlofthegraphicitself(http://www.whatever.com/grphics/MyFirstBanner.gif)
SecondLine-theURLtowheretheviewerisredirectedwhenhe/sheclicksonthebanner.Thiscanbea
dash(-)ifthereisnopagetogoto(thoughIcouldntwonderwhyyouddothis,IMHO)
Thirdline-themou搜索引擎优化vertextthatwillappear
Fourthline-theweightofthegraphicbannerinrespecttotheothers.AccordingtoMicrosoft-
"Forexample,ifaRotatorSchedulefilecontainsthreeadswithimpressionssetto2,3,and5,thefirst
advertisementisdisplayed20percentofthetime,thesecond30percentofthetime,andthethird50
percentofthetime."
Oncethispageisfinished,youmustsaveitandnameit.Forthisexample,Ihavenamedmineadrot.txt.
ItdoesnthavetobeanASPorHTMLfile....noheadersareinvolved,justtheplaintext.
--------------------------------------------------------------------------------
Second-InstantiatetheobjectintheASPpage:
<%DimMyAd
SetMyAd=Server.CreateObject("MSWC.AdRotator")%>
<%=MyAd.GetAdvertisement("/adrot.txt")%>
YoucanputHTMLCentersaroundthissectionofcodetocenteritonthepage.
--------------------------------------------------------------------------------
Now,theresonelastpart-theRedirectionfile.Above,youwillnoticethat,inthisexample,Icalled
itRedirect.asp.Youcancallitanythingyouwant-itdoesntmatterwhatitscalled.
Onthatpageallyouneedisthefollowingcode:
<%Response.Redirect(Request.QueryString("url"))%>
Justremember,ifyouhavecreatedanewpagewithaprogramthatincludesalltheHTMLbasicmarkupand
youputthislineinthefile,youmustputthefollowinglineasthefirstlineofthefilesoitwill
work:
<%Response.Buffer=true%>
Andthatsit-thatsallittakestogettheAdRotatorComponentworking.
</p>ASP在国内异常流行,因为国内大多使用的是盗版的Windows和盗版的SQLServer,而ASP+COM+SQLServer实际上也是一种不错的搭配,其性能也不输于PHP+MYSQL,特别是Windows系统和SQLServer都有图形界面,比APACHE和MYSQL易于维护,因此对于不重视知识产权的国家来说也是一种不错的选择。 封装性使得代码逻辑清晰,易于管理,并且应用到ASP.Net上就可以使业务逻辑和Html页面分离,这样无论页面原型如何改变,业务逻辑代码都不必做任何改动;继承性和多态性使得代码的可重用性大大提高。 Server:这个表示的服务器,操作服务器的一些东西使用这个,如Server.Mappath转换服务器路径,Server.CreateObject实例化一个组件 下面简单介绍一下我学习ASP的方法,希望对想学习ASP的朋友有所帮助... 弱类型造成潜在的出错可能:尽管弱数据类型的编程语言使用起来回方便一些,但相对于它所造成的出错几率是远远得不偿失的。 从事这个行业,那么你可以学ASP语言,简单快速上手,熟练dreamweav排版,写asp代码,熟练photoshop处理图片,打好基础就行了 Application:这个存储服务端的数据,如果不清除,会直到web应用程序结束才清除(例如重启站点) 如何学好ASP,以前也有人问过,把回答给你转过来看看能否对你有帮助: 跟学别的语言一样,先掌握变量,流程控制语句(就是ifwhileselect)等,函数/过程,数组 代码的可重用性差:由于是面向结构的编程方式,并且混合html,所以可能页面原型修改一点,整个程序都需要修改,更别提代码重用了。 弱类型造成潜在的出错可能:尽管弱数据类型的编程语言使用起来回方便一些,但相对于它所造成的出错几率是远远得不偿失的。 我想问如何掌握学习节奏(先学什么再学什么)最好详细点?
页:
[1]