问题描述
我想根据查出来的成绩来决定该列显示的情况:如果成绩大于60,则标签显示为该成绩即可如果成绩=-1,则标签显示为待考,且链接到mytest.aspx?CoureID=....如果成绩为0~59,则标签显示为需要重考,同样链接到mytest.aspx?CoureID=....<asp:GridViewID="GridView1"runat="server"DataSourceID="SqlDataSource1"Width="723px"AutoGenerateColumns="False"AllowPaging="True"BackColor="White"BorderColor="White"BorderStyle="Ridge"BorderWidth="2px"CellPadding="3"CellSpacing="1"GridLines="None"AllowSorting="True"><Columns><asp:HyperLinkFieldHeaderText="课程名称"DataNavigateUrlFields="CourseID,CourseFile,CourseName"DataTextField="CourseName"DataNavigateUrlFormatString="study.aspx?dirs={0}&files={1}&cname={2}"target="_blank"/><asp:BoundFieldDataField="Kind"HeaderText="性质"SortExpression="Kind"/><asp:BoundFieldDataField="StartTime"HeaderText="开课时间"SortExpression="StartTime"dataformatstring="{0:d}"/><asp:TemplateFieldHeaderText="考试情况"><ItemTemplate><asp:LabelID="Label1"runat="server"Text='<%#Eval("Score").ToString().Replace("-1","<ahref=mytest.aspx>待考</a>")'%></asp:Label></ItemTemplate></asp:TemplateField></Columns><FooterStyleBackColor="#C6C3C6"ForeColor="Black"/><RowStyleBackColor="#DEDFDE"ForeColor="Black"/><PagerStyleBackColor="#C6C3C6"ForeColor="Black"HorizontalAlign="Right"/><SelectedRowStyleBackColor="#9471DE"Font-Bold="True"ForeColor="White"/><HeaderStyleBackColor="#4A3C8C"Font-Bold="True"ForeColor="#E7E7FF"/></asp:GridView>
解决方案
解决方案二:
无人响应?