仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 594|回复: 8
打印 上一主题 下一主题

[学习教程] ASP网站制作之DataGrid罕见存眷成绩办理计划

[复制链接]
小女巫 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-16 23:10:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
在实现ERP等高端的ASP应用时,用户需要提供核心的经营资料,需要ASP商有很高的信用度。楼上说交互性不好,太牵强了吧。在微软提供的一套框架中,利用asp做网站,开发效率高,使用人数少,减少不必要的开销。交互性是互动方式,是有开发人员决定的。datagrid|办理|成绩Introduction
TheDataGridWebservercontrolisapowerfultoolfordisplayinginformationfromadatasource.Itiseasytouse;youcandisplayeditabledatainaprofessional-lookinggridbysettingonlyafewproperties.Atthesametime,thegridhasasophisticatedobjectmodelthatprovidesyouwithgreatflexibilityinhowyoudisplaythedata.

Thispaperaddressessomeofthequestionsaboutcustomizinggriddisplaythatarecommonlyaskedinnewsgroups,onWebsites,andinotherdeveloperforums.Thetechniquesdescribedherearesometimesquitesimpleandatothertimessomewhatinvolved.Ineachcase,however,theyaddressaquestionofhowtogobeyondthebasicfunctionalityoftheDataGridcontrol.

Thispaperassumesthatyouarealreadyfamiliarwiththecontrol―howtoaddittoaformandconfigureittodisplaydata.Youshouldalsounderstandhowtoputarowinthegridintoeditmodeandotherbasictasks.(Fordetails,seeDataGridWebServerControl.)Finally,youwillfindithelpfultoknowhowtoworkwithtemplates―addingtemplatecolumnstothegridandlayoutoutcontrolsinsideatemplate.

WindowsFormsversusWebFormsDataGridControl
TheWebFormsDataGridcontrolisnotthesameastheWindowsFormsequivalent.Itisacommon(andnotunreasonable)assumptionthattheyarethesamecontrol,oratleasthaveidenticalfunctionality.However,theentireprogrammingparadigmforWebFormsisquitedifferentfromthatforWindowsForms.Forexample,WebFormspagesperformaroundtriptotheserverforanyprocessing;theymustmanagestate;theyfeatureaverydifferentdata-bindingmodel;andsoon.

Becauseofthesedifferences,therearealsosignificantdifferencesintheirrespectivecontrols,includingtheDataGridcontrol.Asageneralrule,theWebFormsDataGridcontrolincludeslessbuilt-infunctionality.AfewexamplesofdifferencesintheWebFormsDataGridcontrolare:

Itdoesnotinherentlysupportmaster-detaildatastructures.
AswithotherWebservercontrols,itdoesnotsupporttwo-waydatabinding.Ifyouwanttoupdatedata,youmustwritecodetodothisyourself.
Youcanonlyeditonerowatatime.
Itdoesnotinherentlysupportsorting,althoughitraiseseventsyoucanhandleinordertosortthegridcontents.
Ontheotherhand:

YoucanbindtheWebFormsDataGridtoanyobjectthatsupportstheIEnumerableinterface.
TheWebFormsDataGridcontrolsupportspaging.
ItiseasytocustomizetheappearanceandlayoutoftheWebFormsDataGridcontrolascomparedtotheWindowsFormsone.(Detailsareprovidedlaterinthispaper.)
ControllingColumnWidth,Height,andAlignment
Bydefault,theDataGridcontrolsizesrowsandcolumnstofittheoverallheightandwidththatyouhaveassignedtothegrid.Withintheoverallgridwidth,itsizescolumnsaccordingtothewidthofthecolumnheadingtext.Alldataisdisplayedleft-justifiedbydefault.

Tocontrolcolumncharacteristics,youshouldturnoffautocolumngenerationbysettingtheAutoGenerateColumnspropertytofalse.Infact,youshouldsetthispropertytotrueonlyforshort-termuses,suchasquickproof-of-conceptpagesordemonstrations.Forproductionapplications,youshouldaddcolumnsexplicitly.Theindividualcolumnscanbeboundcolumnsortemplatecolumns.

Tosetthecolumnwidth,youcreateastyleelementforthatcolumnandthensettheelementsWidthpropertytostandardunits(say,pixels).ThefollowingexampleshowsyouwhattheHTMLsyntaxlookslikeforanItemStyleelementwithitsWidthpropertyset.

<asp:BoundColumnDataField="title"SortExpression="title"
HeaderText="Title">
<ItemStyleWidth="100px"></ItemStyle>
</asp:BoundColumn>
Alternatively,youcandothesamethingbysettingtheItemStylepropertydirectlyintheelement,asinthefollowingexample:

<asp:BoundColumnItemStyle-Width="100px"DataField="title"
SortExpression="title"HeaderText="Title">
</asp:BoundColumn>
Youcansetalignmentusingthestyleelement,settingitto"Right,""Left,"andothervaluesdefinedintheHorizontalAlignenumeration.(InVisualStudio,alignmentisavailableforindividualcolumnsintheFormattabofthegridsPropertybuilder.)Thefollowingisanexample:

<asp:BoundColumnDataField="title"SortExpression="title"
HeaderText="Title">
<ItemStyleWidth="100px"HorizontalAlign="Right"></ItemStyle>
</asp:Bound</p>
[1][2][3][4][5][6][7][8][9][10]下一页>>

asp,jsp,php是web开发的三大技术,asp简单易用且有microsoft做靠山,jsp功能强大是因为有java支持,php则开源跨平台.在国内,asp应用范围最广,jsp发展势头最猛,php则处于劣势.这可能与公司的支持以及技术的培训有关.
简单生活 该用户已被删除
沙发
发表于 2015-1-20 07:45:39 | 只看该作者
接下来就不能纸上谈兵了,最好的方法其实是实践。实践,只能算是让你掌握语言特性用的。而提倡做实际的Project也不是太好,因为你还没有熟练的能力去综合各种技术,这样只能使你自己越来越迷糊。
兰色精灵 该用户已被删除
板凳
发表于 2015-1-29 05:12:22 | 只看该作者
掌握asp的特性而且一定要知道为什么。
不帅 该用户已被删除
地板
发表于 2015-1-30 14:48:50 | 只看该作者
ASP主要是用好六个对象,其实最主要的是用好其中两个:response和request,就可以随心所欲地控制网页变换和响应用户动作了。
愤怒的大鸟 该用户已被删除
5#
发表于 2015-2-6 13:28:56 | 只看该作者
我们必须明确一个大方向,不要只是停留在因为学而去学,我们应有方向应有目标.
透明 该用户已被删除
6#
发表于 2015-2-16 07:07:22 | 只看该作者
多看多学多思。多看一些关于ASP的书籍,一方面可以扩展知识面一方面可以鉴借别人是如何掌握、运用ASP的;多学善于关注别人,向同学老师多多学习,不论知识的大小;多思则是要将学到的知识灵活运用。
小女巫 该用户已被删除
7#
 楼主| 发表于 2015-3-11 22:03:24 | 只看该作者
交流是必要的,不管是生活还是学习我们都要试着去交流,通过交流我们可以学到很多我们自己本身所没有的知识,可以分享别人的经验甚至经历。
海妖 该用户已被删除
8#
发表于 2015-3-19 14:49:57 | 只看该作者
以HTML语言整合(HTML负责界面上,ASP则负责功能上)形成一个B/S(浏览器/服务器)模式的网页程序。
第二个灵魂 该用户已被删除
9#
发表于 2015-3-28 13:33:27 | 只看该作者
如何学好ASP,以前也有人问过,把回答给你转过来看看能否对你有帮助:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-5 19:12

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表